diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-03-14 17:17:38 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2008-03-14 17:17:38 +0000 |
commit | 51da7aa3cafc86c9a1d3902948f5a674bffc15f7 (patch) | |
tree | a3ca0f55f16b8d7c745f784375ac6ad48e830177 /gcc/testsuite/gcc.c-torture | |
parent | 4a700f9d166839b2c8c83e87a9b15a634300f529 (diff) |
svn merge -r133000:133221 svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch/
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_3-branch@133223 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr35456.c | 21 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr35472.c | 22 |
2 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr35456.c b/gcc/testsuite/gcc.c-torture/execute/pr35456.c new file mode 100644 index 00000000000..175a0b2abfa --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr35456.c @@ -0,0 +1,21 @@ +extern void abort (void); + +double +__attribute__ ((noinline)) +not_fabs (double x) +{ + return x >= 0.0 ? x : -x; +} + +int main() +{ + double x = -0.0; + double y; + + y = not_fabs (x); + + if (!__builtin_signbit (y)) + abort(); + + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr35472.c b/gcc/testsuite/gcc.c-torture/execute/pr35472.c new file mode 100644 index 00000000000..c8678e268c9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr35472.c @@ -0,0 +1,22 @@ +extern void abort (void); +extern void *memset (void *s, int c, __SIZE_TYPE__ n); +struct S { int i[16]; }; +struct S *p; +void __attribute__((noinline)) +foo(struct S *a, struct S *b) { a->i[0] = -1; p = b; } +void test (void) +{ + struct S a, b; + memset (&a.i[0], '\0', sizeof (a.i)); + memset (&b.i[0], '\0', sizeof (b.i)); + foo (&a, &b); + *p = a; + *p = b; + if (b.i[0] != -1) + abort (); +} +int main() +{ + test(); + return 0; +} |