Debian Codegraph @

gcc/testsuite/g++.dg/gomp/declare-variant-class-1.C

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-foffload=disable" } */
3 /* { dg-additional-options "-mavx512bw -mavx512vl" { target { i?86-*-* x86_64-*-* } } } */
4
5 /* References to function parameters in dynamic selector expressions for
6 "declare variant" isn't supported yet; see PR 113904. Check to see that
7 a proper error is diagnosed meanwhile and GCC doesn't just wander off
8 into the weeds and ICE. */
9
10 extern int frob (int);
11
12 class junk
13 {
14 public:
15 int data;
16 static void f01 (int, int);
17 static void f02 (int, int);
18 static void f03 (int, int);
19 #pragma omp declare variant (f01) match (target_device={device_num (devnum), isa("avx512f","avx512vl")}) /* { dg-message "sorry, unimplemented: reference to function parameter" } */
20 #pragma omp declare variant (f02) match (implementation={vendor(score(15):gnu)})
21 #pragma omp declare variant (f03) match (user={condition(score(11):frob (ok + 42))}) /* { dg-message "sorry, unimplemented: reference to function parameter" } */
22 static void f04 (int devnum, int ok);
23 };
24
25 void
26 test1 (void)
27 {
28 int i;
29 #pragma omp parallel for
30 for (i = 0; i < 1; i++)
31 junk::f04 (17, 1);
32 }