aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/asmgoto-3.c
blob: 842b73e772df8875982c2b7630739d1bacaba2a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */

int
foo (void)
{
  int x;
  
  asm goto ("": "=a" (x) : : : lab);
 lab:
  return x;
}

int
foo2 (void)
{
  int x, y;
  
  asm goto ("": "=a" (x), "=d" (y) : : : lab, lab2);
 lab:
  return x;
 lab2:
  return y;
}

int
foo3 (void)
{
  int x, y, z;
  
  asm goto ("": "=a" (x), "=d" (y), "=c" (z) : : : lab, lab2, lab3);
 lab:
  return x;
 lab2:
  return y;
 lab3:
  return z;
}

int
foo4 (void)
{
  int x, y, z, v;
  
  asm goto ("": "=a" (x), "=d" (y), "=c" (z) , "=b" (v) : : : lab, lab2, lab3, lab4);
 lab:
  return x;
 lab2:
  return y;
 lab3:
  return z;
 lab4:
  return v;
}

int
foo5 (void)
{
  int x, y, z, v, w;
  
  asm goto ("": "=a" (x), "=d" (y), "=c" (z), "=b" (v), "=S" (w) : : : lab, lab2, lab3, lab4, lab5);
 lab:
  return x;
 lab2:
  return y;
 lab3:
  return z;
 lab4:
  return v;
 lab5:
  return w;
}

int
foo6 (void)
{
  int x = 0, y = 1, z = 2, v = 3, w = 4;
  
  asm goto ("": "+a" (x), "+d" (y), "+c" (z), "+b" (v), "+S" (w) : : : lab, lab2, lab3, lab4, lab5);
 lab:
  return x;
 lab2:
  return y;
 lab3:
  return z;
 lab4:
  return v;
 lab5:
  return w;
}