diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-11 13:40:31 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-11 13:40:31 +0000 |
commit | 35ff54b5d4aaea200c2e33527e452ca0a5292fc4 (patch) | |
tree | e1632c6ff1de20355a3f4f7074b072de291d3d44 /libgomp/testsuite/libgomp.c | |
parent | e9a9dc0931b409f259957ea331ce42e1760ff21f (diff) | |
download | gcc-35ff54b5d4aaea200c2e33527e452ca0a5292fc4.tar.gz |
PR c/64824
* c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec
check in the POP macro.
* testsuite/libgomp.c/atomic-18.c: New test.
* testsuite/libgomp.c++/atomic-16.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220617 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite/libgomp.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/atomic-18.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/atomic-18.c b/libgomp/testsuite/libgomp.c/atomic-18.c new file mode 100644 index 00000000000..bd048c1094c --- /dev/null +++ b/libgomp/testsuite/libgomp.c/atomic-18.c @@ -0,0 +1,61 @@ +/* PR c/64824 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fopenmp" } */ + +void +f1 (void) +{ + short a; + short b = 1; + int c = 3; +#pragma omp atomic capture + a = b = c << b; + if (b != 6 || a != 6) + __builtin_abort (); +} + +void +f2 (void) +{ + short a; + short b = 1; + int c = 3; +#pragma omp atomic capture + a = b = c + b; + if (b != 4 || a != 4) + __builtin_abort (); +} + +void +f3 (void) +{ + short a; + short b = 1; + long long int c = 3; +#pragma omp atomic capture + a = b = c + b; + if (b != 4 || a != 4) + __builtin_abort (); +} + +void +f4 (void) +{ + char a; + char b = 1; + long long int c = 3LL; +#pragma omp atomic capture + a = b = c << b; + if (b != 6 || a != 6) + __builtin_abort (); +} + +int +main () +{ + f1 (); + f2 (); + f3 (); + f4 (); + return 0; +} |