diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-07 23:08:43 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-07 23:08:43 +0000 |
commit | dc91cf0673605c1d137f8a48374d3918cb66bcbc (patch) | |
tree | e54033bcfb2a9fb6de2da41f1f066a6ca105a8ae | |
parent | c471e1b32c7271e01012958b8876d5ab776960d1 (diff) | |
download | gcc-dc91cf0673605c1d137f8a48374d3918cb66bcbc.tar.gz |
2014-11-07 Andrew Pinski <apinski@cavium.com>
* gcc.c-torture/execute/20141107-1.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217242 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20141107-1.c | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba9df2cfb28..1a3d6f6f33e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-11-07 Andrew Pinski <apinski@cavium.com> + + * gcc.c-torture/execute/20141107-1.c: New testcase. + 2014-11-07 Richard Biener <rguenther@suse.de> PR tree-optimization/63605 diff --git a/gcc/testsuite/gcc.c-torture/execute/20141107-1.c b/gcc/testsuite/gcc.c-torture/execute/20141107-1.c new file mode 100644 index 00000000000..e4590b39e49 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20141107-1.c @@ -0,0 +1,27 @@ +#define bool _Bool + +bool f(int a, bool c) __attribute__((noinline)); +bool f(int a, bool c) +{ + if (!a) + c = !c; + return c; +} + +void checkf(int a, bool b) +{ + bool c = f(a, b); + char d; + __builtin_memcpy (&d, &c, 1); + if ( d != (a==0)^b) + __builtin_abort(); +} + +int main(void) +{ + checkf(0, 0); + checkf(0, 1); + checkf(1, 1); + checkf(1, 0); + return 0; +} |