From 3c56f697e112c79fb5457538fdc373e348beca24 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Thu, 8 Nov 2012 09:43:39 -0800 Subject: Initial checkin of unmodified gcc-5666.3.tar.gz This is the source to build gcc-4.2 for MacOSX gcc version 4.2.1 (Apple Inc. build 5666) (dot 3) http://opensource.apple.com/tarballs/gcc/gcc-5666.3.tar.gz Change-Id: I69540223f018e9d07f861fca04bd3833fc138f8b --- .../libgomp/testsuite/libgomp.c/nestedfn-5.c | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c/nestedfn-5.c (limited to 'gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c/nestedfn-5.c') diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c/nestedfn-5.c b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c/nestedfn-5.c new file mode 100644 index 000000000..6072b1fe3 --- /dev/null +++ b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.c/nestedfn-5.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +void +foo (int *j) +{ + int i = 5; + int bar (void) { return i + 1; } +#pragma omp sections + { + #pragma omp section + { + if (bar () != 6) + #pragma omp atomic + ++*j; + } + #pragma omp section + { + if (bar () != 6) + #pragma omp atomic + ++*j; + } + } +} + +int +main (void) +{ + int j = 0; +#pragma omp parallel num_threads (2) + foo (&j); + if (j) + abort (); + return 0; +} + -- cgit v1.2.3