libgomp/testsuite/libgomp.c/loop-16.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | extern void abort (void); |
| 4 | |
| 5 | volatile int count; |
| 6 | static int test (void) |
| 7 | { |
| 8 | return ++count > 0; |
| 9 | } |
| 10 | |
| 11 | int i; |
| 12 | |
| 13 | int |
| 14 | main () |
| 15 | { |
| 16 | #pragma omp for lastprivate (i) |
| 17 | for (i = 0; i < 10; ++i) |
| 18 | { |
| 19 | int *p = &i; |
| 20 | if (test ()) |
| 21 | continue; |
| 22 | abort (); |
| 23 | } |
| 24 | if (i != count) |
| 25 | abort (); |
| 26 | return 0; |
| 27 | } |