gcc/testsuite/c-c++-common/gomp/pr90954.c
raw| 1 | /* PR sanitizer/90954 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-fopenmp -fsanitize=undefined" } */ |
| 4 | |
| 5 | float v; |
| 6 | int i; |
| 7 | |
| 8 | void |
| 9 | foo (float x, float y) |
| 10 | { |
| 11 | #pragma omp atomic |
| 12 | v += x / y; |
| 13 | } |
| 14 | |
| 15 | void |
| 16 | bar (int x, int y) |
| 17 | { |
| 18 | #pragma omp atomic |
| 19 | i += x / y; |
| 20 | } |
| 21 | |
| 22 | void |
| 23 | baz (int x, int y) |
| 24 | { |
| 25 | #pragma omp atomic |
| 26 | i *= (x << y); |
| 27 | } |