Debian Codegraph @

gcc/testsuite/g++.dg/gomp/declare-variant-class-2.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 extern int frobmore (class junk *);
12
13 class junk
14 {
15 public:
16 int data;
17 void f01 (int, int);
18 void f02 (int, int);
19 void f03 (int, int);
20 void f04 (int, int);
21 void f05 (int, int);
22 #pragma omp declare variant (f01) match (target_device={device_num (devnum), isa("avx512f","avx512vl")}) /* { dg-message "sorry, unimplemented: reference to function parameter" } */
23 #pragma omp declare variant (f02) match (implementation={vendor(score(15):gnu)})
24 #pragma omp declare variant (f03) match (user={condition(score(11):frob (ok + 42))}) /* { dg-message "sorry, unimplemented: reference to function parameter" } */
25 #pragma omp declare variant (f04) match (user={condition(score(11):data)}) /* { dg-message "sorry, unimplemented: reference to function parameter" } */
26 #pragma omp declare variant (f05) match (user={condition(score(11):frobmore (this))}) /* { dg-message "sorry, unimplemented: reference to function parameter" } */
27 void f06 (int devnum, int ok);
28 };
29
30 void
31 test1 (junk *j)
32 {
33 int i;
34 #pragma omp parallel for
35 for (i = 0; i < 1; i++)
36 j->f06 (17, 1);
37 }