PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr80421.c
blobb13ab5fc121e5a827e39610707869cfc78e9b0d2
1 /* PR middle-end/80421 */
3 __attribute__ ((noinline, noclone)) void
4 baz (const char *t, ...)
6 asm volatile (""::"r" (t):"memory");
7 if (*t == 'T')
8 __builtin_abort ();
11 unsigned int
12 foo (char x)
14 baz ("x %c\n", x);
15 switch (x)
17 default:
18 baz ("case default\n");
19 if (x == 'D' || x == 'I')
20 baz ("This should never be reached.\n");
21 return 0;
22 case 'D':
23 baz ("case 'D'\n");
24 return 0;
25 case 'I':
26 baz ("case 'I'\n");
27 return 0;
31 void
32 bar (void)
34 int a = 2;
35 int b = 5;
36 char c[] = {
37 2, 4, 1, 2, 5, 5, 2, 4, 4, 0, 0, 0, 0, 0, 0, 3, 4, 4, 2, 4,
38 1, 2, 5, 5, 2, 4, 1, 0, 0, 0, 2, 4, 4, 3, 4, 3, 3, 5, 1, 3,
39 5, 5, 2, 4, 4, 2, 4, 1, 3, 5, 3, 3, 5, 1, 3, 5, 1, 2, 4, 4,
40 2, 4, 2, 3, 5, 1, 3, 5, 1, 3, 5, 5, 2, 4, 1, 2, 4, 2, 3, 5,
41 3, 3, 5, 1, 3, 5, 5, 2, 4, 1, 2, 4, 1, 3, 5, 3, 3, 5, 1, 3,
42 5, 5, 2, 4, 4, 2, 4, 1, 3, 5, 3, 3, 5, 1, 3, 5, 1, 2, 4, 1,
43 2, 4, 2, 3, 5, 1, 3, 5, 1, 3, 5, 1, 2, 4, 1, 2, 4, 1, 3, 5,
44 1, 3, 5, 1, 3, 5, 1, 2, 4, 4, 2, 4, 1, 3, 5, 1, 3, 5, 1, 3,
45 5, 5, 2, 4, 4, 2, 4, 2, 3, 5, 3, 3, 5, 1, 3, 5, 5, 2, 4, 4,
46 2, 4, 1, 3, 5, 3, 3, 5, 1, 3, 5, 1, 2, 5, 5, 2, 4, 2, 3, 5,
47 1, 3, 4, 1, 3, 5, 1, 2, 5, 5, 2, 4, 1, 2, 5, 1, 3, 5, 3, 3,
48 5, 1, 2, 5, 5, 2, 4, 2, 2, 5, 1, 3, 5, 3, 3, 5, 1, 2, 5, 1,
49 2, 4, 1, 2, 5, 2, 3, 5, 1, 3, 5, 1, 2, 5, 1, 2, 4, 2, 2, 5,
50 1, 3, 5, 1, 3, 5, 1, 2, 5, 5, 2, 4, 2, 2, 5, 2, 3, 5, 3, 3,
51 5, 1, 2, 5, 5, 2, 4, 2, 2, 5, 2, 3, 5, 3, 3, 5, 1, 2, 5, 5,
52 2, 4, 2, 2, 5, 1, 3, 5, 3, 3, 5, 1, 2, 5, 5, 2, 4, 2, 2, 5,
53 1, 3, 5, 3, 3, 5, 1, 2, 5, 1, 2, 4, 1, 2, 5, 2, 3, 5, 1, 3,
54 5, 1, 2, 5, 5, 2, 4, 2, 2, 5, 2, 3, 5, 3, 3, 5, 1, 2, 5, 5,
55 2, 4, 1, 2, 5, 1, 3, 5, 3, 3, 5, 1, 2, 5, 5, 2, 4, 2, 2, 5,
56 1, 3, 5, 3, 3, 5, 1, 2, 5, 5, 2, 4, 2, 2, 5, 1, 3, 5, 3, 3,
57 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
59 char *f = c + 390;
60 int i, j, e, g, h;
61 char k, l;
62 i = 26;
63 j = 25;
64 k = l = 'M';
65 h = 2;
66 while (i > 0)
68 int x = i - a;
69 x = x > 0 ? x : 0;
70 x = j - x;
71 g = x * 3 + h;
72 switch (f[g])
74 case 1:
75 --i;
76 --j;
77 h = 2;
78 f -= b * 3;
79 k = 'M';
80 break;
81 case 2:
82 --i;
83 h = 0;
84 f -= b * 3;
85 k = 'I';
86 break;
87 case 3:
88 --i;
89 h = 2;
90 f -= b * 3;
91 k = 'I';
92 break;
93 case 4:
94 --j;
95 h = 1;
96 k = 'D';
97 break;
98 case 5:
99 --j;
100 h = 2;
101 k = 'D';
102 break;
104 if (k == l)
105 ++e;
106 else
108 foo (l);
109 l = k;
115 main ()
117 char l = 'D';
118 foo (l);
119 bar ();
120 return 0;