Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/pr118965-2.c

raw
1 /* { dg-do compile } */
2
3 /* At least one of the target and/or targetsync modifiers must be provided. */
4
5 #if __cplusplus >= 201103L
6 # define __GOMP_UINTPTR_T_ENUM : __UINTPTR_TYPE__
7 #else
8 # define __GOMP_UINTPTR_T_ENUM
9 #endif
10
11 typedef enum omp_interop_t __GOMP_UINTPTR_T_ENUM
12 {
13 omp_interop_none = 0,
14 __omp_interop_t_max__ = __UINTPTR_MAX__
15 } omp_interop_t;
16
17 void f1(omp_interop_t) { }
18 #pragma omp declare variant(f1) match(construct={dispatch}) \
19 append_args(interop(prefer_type({attr("ompx_fun")})))
20 // { dg-error "missing required 'target' and/or 'targetsync' modifier" "" { target *-*-* } .-1 }
21 void g1(void);
22
23
24 int f2(omp_interop_t, omp_interop_t);
25 #pragma omp declare variant(f2) \
26 append_args(interop(prefer_type("cuda")), \
27 interop(prefer_type({fr("hsa")}))) \
28 match(construct={dispatch})
29 // { dg-error "missing required 'target' and/or 'targetsync' modifier" "" { target *-*-* } .-3 }
30 // { dg-error "missing required 'target' and/or 'targetsync' modifier" "" { target *-*-* } .-3 }
31 int g2(void) { return 5; }