// Test parsing of #pragma omp declare variant // { dg-do compile } // { dg-additional-options "-fdump-tree-gimple" } void f01 (); #pragma omp declare variant (f01) match (user={condition(1)},device={arch(x86_64)}) template void f02 (); void f03 (); #pragma omp declare variant (f03) match (user={condition(score(N+2):N)}) template void f04 (); template void f05 (); #pragma omp declare variant (f05) match (user={condition((T)N)},implementation={vendor("gnu")}) template void f06 (); void f07 (); #pragma omp declare variant (f07) match (user={condition(score(N+2):N)}) template void f08 (); template void f09 (); #pragma omp declare variant (f09) match (user={condition((T) N)}) template void f10 (); template struct S { template void f11 (T) {} #pragma omp declare variant (f11) match (user={condition(score(N):N)}) template void f12 (T) {} template void f13 (T); #pragma omp declare variant (f13) match (user={condition(score(N):N)}) template void f14 (T); int s; }; template struct T { template void f15 (T) {} #pragma omp declare variant (f15) match (user={condition(score(N):N)}) template void f16 (T) {} template void f17 (T); #pragma omp declare variant (f17) match (user={condition(score(N):N)}) template void f18 (T); int t; }; void test () { f02<1> (); // { dg-final { scan-tree-dump-times "f01 \\\(\\\);" 1 "gimple" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } // { dg-final { scan-tree-dump-times "f02<1> \\\(\\\);" 1 "gimple" { target { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } // { dg-final { scan-tree-dump-times "f02<1> \\\(\\\);" 1 "gimple" { target { ! { i?86-*-* x86_64-*-* } } } } } f04<1> (); // { dg-final { scan-tree-dump-times "f03 \\\(\\\);" 1 "gimple" } } f06<1, long> (); // { dg-final { scan-tree-dump-times "f05<1> \\\(\\\);" 1 "gimple" } } f08<0> (); // { dg-final { scan-tree-dump-times "f08<0> \\\(\\\);" 1 "gimple" } } f10<0, short int> (); // { dg-final { scan-tree-dump-times "f10<0, short int> \\\(\\\);" 1 "gimple" } } S<1> s; s.f12 (0); // { dg-final { scan-tree-dump-times "S<1>::f11 \\\(&s, 0\\\);" 1 "gimple" } } s.f12 (0.0); // { dg-final { scan-tree-dump-times "S<1>::f11 \\\(&s, 0.0\\\);" 1 "gimple" } } s.f14 (0LL); // { dg-final { scan-tree-dump-times "S<1>::f13 \\\(&s, 0\\\);" 1 "gimple" } } T<0> t; t.f16 (s); // { dg-final { scan-tree-dump-times "T<0>::f16 > \\\(&t, s\\\);" 1 "gimple" } } t.f18 (s); // { dg-final { scan-tree-dump-times "T<0>::f18 > \\\(&t, s\\\);" 1 "gimple" } } }