Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / pr44071.c
blob514c5e2fd2c1017a71e61924b17868b71e1bcbf8
1 /* PR middle-end/44071 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
5 static inline int
6 f1 (void)
8 asm goto ("jmp %l[l1]" : : : : l1, l2);
9 __builtin_unreachable ();
10 l1:
11 return 1;
12 l2:
13 return 0;
16 __attribute__((noinline)) int
17 b1 (int x)
19 if (f1 () || x == 6)
20 x = 1;
21 else
22 x = 2;
23 return x;
26 static inline int
27 f2 (void)
29 asm goto ("jmp %l[l2]" : : : : l1, l2);
30 __builtin_unreachable ();
31 l1:
32 return 1;
33 l2:
34 return 0;
37 __attribute__((noinline)) int
38 b2 (int x)
40 if (f2 () || x == 6)
41 x = 1;
42 else
43 x = 2;
44 return x;
47 static inline int
48 f3 (void)
50 asm goto ("jmp %l[l1]" : : : : l1, l2);
51 l1:
52 return 1;
53 l2:
54 return 0;
57 __attribute__((noinline)) int
58 b3 (int x)
60 if (f3 () || x == 6)
61 x = 1;
62 else
63 x = 2;
64 return x;
67 static inline int
68 f4 (void)
70 asm goto ("jmp %l[l2]" : : : : l1, l2);
71 l1:
72 return 1;
73 l2:
74 return 0;
77 __attribute__((noinline)) int
78 b4 (int x)
80 if (f4 () || x == 6)
81 x = 1;
82 else
83 x = 2;
84 return x;
87 extern void abort (void);
89 int
90 main (void)
92 int x;
93 asm ("" : "=r" (x) : "0" (0));
94 if (b1 (x) != 1 || b1 (x + 6) != 1)
95 abort ();
96 if (b2 (x) != 2 || b2 (x + 6) != 1)
97 abort ();
98 if (b3 (x) != 1 || b3 (x + 6) != 1)
99 abort ();
100 if (b4 (x) != 2 || b4 (x + 6) != 1)
101 abort ();
102 return 0;