diff options
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/builtin-constant.c | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2b88c1f..be1e602 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-11-02 Diego Novillo <dnovillo@redhat.com> + + PR optimization/8423 + * gcc.c-torture/execute/builtin-constant.c: New test. + 2002-11-01 Zack Weinberg <zack@codesourcery.com> * g++.dg/ext/typedef-init.C, gcc.dg/typedef-init.C: diff --git a/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c b/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c new file mode 100644 index 0000000..9e5bfb8 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c @@ -0,0 +1,26 @@ +/* PR optimization/8423. */ + +#define btest(x) __builtin_constant_p(x) ? "1" : "0" + +#ifdef __OPTIMIZE__ +void +foo (char *i) +{ + if (*i == '0') + abort (); +} +#else +void +foo (char *i) +{ +} +#endif + +int +main (void) +{ + int size = sizeof (int); + foo (btest (size)); + foo (btest (size)); + exit (0); +} |
