diff options
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/20020107-1.c')
-rw-r--r-- | SingleSource/Regression/C/gcc-c-torture/execute/20020107-1.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/20020107-1.c b/SingleSource/Regression/C/gcc-c-torture/execute/20020107-1.c new file mode 100644 index 00000000..23d8aebf --- /dev/null +++ b/SingleSource/Regression/C/gcc-c-torture/execute/20020107-1.c @@ -0,0 +1,29 @@ +/* This testcase failed because - 1 - buf was simplified into ~buf and when + later expanding it back into - buf + -1, -1 got lost. */ +/* { dg-options "-fgnu89-inline" } */ + +extern void abort (void); +extern void exit (int); + +static void +bar (int x) +{ + if (!x) + abort (); +} + +char buf[10]; + +inline char * +foo (char *tmp) +{ + asm ("" : "=r" (tmp) : "0" (tmp)); + return tmp + 2; +} + +int +main (void) +{ + bar ((foo (buf) - 1 - buf) == 1); + exit (0); +} |