aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/parallel-1.C
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2006-03-09 10:14:39 -0800
committerRichard Henderson <rth@gcc.gnu.org>2006-03-09 10:14:39 -0800
commit1799e5d5ca20304e32f7d1134ba5e8a2ab231880 (patch)
tree461ecbd500b6dd4b3b219e43f1580a187a1407cf /libgomp/testsuite/libgomp.c++/parallel-1.C
parentf8fe05458d2116e5dcd2aa3eac9dff868be27cfb (diff)
downloadgcc-1799e5d5ca20304e32f7d1134ba5e8a2ab231880.zip
gcc-1799e5d5ca20304e32f7d1134ba5e8a2ab231880.tar.gz
gcc-1799e5d5ca20304e32f7d1134ba5e8a2ab231880.tar.bz2
Merge C++ from gomp-20050608-branch.
From-SVN: r111867
Diffstat (limited to 'libgomp/testsuite/libgomp.c++/parallel-1.C')
-rw-r--r--libgomp/testsuite/libgomp.c++/parallel-1.C40
1 files changed, 40 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/parallel-1.C b/libgomp/testsuite/libgomp.c++/parallel-1.C
new file mode 100644
index 0000000..3c93147
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/parallel-1.C
@@ -0,0 +1,40 @@
+#include <omp.h>
+
+extern "C" void abort (void);
+
+int
+foo (void)
+{
+ return 10;
+}
+
+main ()
+{
+ int A = 0;
+
+ #pragma omp parallel if (foo () > 10) shared (A)
+ {
+ A = omp_get_num_threads ();
+ }
+
+ if (A != 1)
+ abort ();
+
+ #pragma omp parallel if (foo () == 10) num_threads (3) shared (A)
+ {
+ A = omp_get_num_threads ();
+ }
+
+ if (A != 3)
+ abort ();
+
+ #pragma omp parallel if (foo () == 10) num_threads (foo ()) shared (A)
+ {
+ A = omp_get_num_threads ();
+ }
+
+ if (A != 10)
+ abort ();
+
+ return 0;
+}