diff options
Diffstat (limited to 'libgomp/testsuite/libgomp.c/loop-16.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/loop-16.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/loop-16.c b/libgomp/testsuite/libgomp.c/loop-16.c new file mode 100644 index 00000000000..3ef2f6489bd --- /dev/null +++ b/libgomp/testsuite/libgomp.c/loop-16.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ + +extern void abort (void); + +volatile int count; +static int test (void) +{ + return ++count > 0; +} + +int i; + +int +main () +{ + #pragma omp for lastprivate (i) + for (i = 0; i < 10; ++i) + { + int *p = &i; + if (test ()) + continue; + abort (); + } + if (i != count) + abort (); + return 0; +} |