OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20020107-1.c
1 /* This testcase failed because - 1 - buf was simplified into ~buf and when
2    later expanding it back into - buf + -1, -1 got lost.  */
3
4 extern void abort (void);
5 extern void exit (int);
6
7 static void
8 bar (int x)
9 {
10   if (!x)
11     abort ();
12 }
13
14 char buf[10];
15
16 inline char *
17 foo (char *tmp)
18 {
19   asm ("" : "=r" (tmp) : "0" (tmp));
20   return tmp + 2;
21 }
22
23 int
24 main (void)
25 {
26   bar ((foo (buf) - 1 - buf) == 1);
27   exit (0);
28 }