aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-05-19 15:11:56 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-05-19 15:11:56 +0200
commitea93a47bc825a409079665551203aa194e71fc18 (patch)
tree8a93ed0f8e4aefee902ff63a0c36dfb80398207e /libgomp/testsuite
parent5ee093edf0ff049ece01649376c1b2975e0371f2 (diff)
downloadgcc-ea93a47bc825a409079665551203aa194e71fc18.zip
gcc-ea93a47bc825a409079665551203aa194e71fc18.tar.gz
gcc-ea93a47bc825a409079665551203aa194e71fc18.tar.bz2
re PR c++/49043 ([OpenMP & C++0x]: Compiler error when lambda-function within OpenMP loop)
PR c++/49043 * decl.c (check_omp_return): Stop searching on sk_function_parms. * testsuite/libgomp.c++/pr49043.C: New test. From-SVN: r173907
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/libgomp.c++/pr49043.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/pr49043.C b/libgomp/testsuite/libgomp.c++/pr49043.C
new file mode 100644
index 0000000..604cfc3
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr49043.C
@@ -0,0 +1,19 @@
+// PR c++/49043
+// { dg-options "-std=c++0x" }
+// { dg-do run }
+
+extern "C" void abort ();
+
+int
+main ()
+{
+ int r = 0;
+ #pragma omp parallel for reduction (+:r)
+ for (int a = 0; a < 10; ++a)
+ {
+ auto func = [=] () { return a; };
+ r += func ();
+ }
+ if (r != 45)
+ abort ();
+}