diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20111227-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20111227-1.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20111227-1.c b/gcc/testsuite/gcc.c-torture/execute/20111227-1.c new file mode 100644 index 00000000000..9fe330d6e99 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20111227-1.c @@ -0,0 +1,30 @@ +/* PR rtl-optimization/51667 */ +/* Testcase by Uros Bizjak <ubizjak@gmail.com> */ + +extern void abort (void); + +void __attribute__((noinline,noclone)) +bar (int a) +{ + if (a != -1) + abort (); +} + +void __attribute__((noinline,noclone)) +foo (short *a, int t) +{ + short r = *a; + + if (t) + bar ((unsigned short) r); + else + bar ((signed short) r); +} + +short v = -1; + +int main(void) +{ + foo (&v, 0); + return 0; +} |