From: Jakub Jelinek Date: Wed, 30 Oct 2019 12:17:16 +0000 (+0100) Subject: * g++.dg/gomp/declare-variant-6.C: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=095578b5bc9f2ff72785ff14626c6a803c973176;p=gcc.git * g++.dg/gomp/declare-variant-6.C: New test. From-SVN: r277620 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 59c2e561af6..d4cf73c100a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-10-30 Jakub Jelinek + + * g++.dg/gomp/declare-variant-6.C: New test. + 2019-10-30 Martin Liska * c-c++-common/Wstringop-truncation-4.c: Disable IPA ICF. diff --git a/gcc/testsuite/g++.dg/gomp/declare-variant-6.C b/gcc/testsuite/g++.dg/gomp/declare-variant-6.C new file mode 100644 index 00000000000..f19dad5db0d --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/declare-variant-6.C @@ -0,0 +1,26 @@ +// Test parsing of #pragma omp declare variant +// { dg-do compile { target c++11 } } +// { dg-additional-options "-fdump-tree-gimple" } + +constexpr int score (int x) { return x; } +void f0 (); +#pragma omp declare variant (f0) match (user={condition(score(1))}) +void f1 (); +void f2 (); +#pragma omp declare variant (f2) match (user={condition(score(1):1)}) +void f3 (); +void f4 (); +#pragma omp declare variant (f4) match (user={condition(score(1):score(1))}) +void f5 (); +void f6 (); +#pragma omp declare variant (f6) match (user={condition(score(1)==0)}) +void f7 (); + +void +test () +{ + f1 (); // { dg-final { scan-tree-dump-times "f0 \\\(\\\);" 1 "gimple" } } + f3 (); // { dg-final { scan-tree-dump-times "f2 \\\(\\\);" 1 "gimple" } } + f5 (); // { dg-final { scan-tree-dump-times "f4 \\\(\\\);" 1 "gimple" } } + f7 (); // { dg-final { scan-tree-dump-times "f7 \\\(\\\);" 1 "gimple" } } +}