Debian Codegraph @

libgomp/testsuite/libgomp.oacc-c++/pr119692-1-1.C

raw
1 /* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
2
3 /* { dg-additional-options -UDEFAULT }
4 Wrong code for offloading execution.
5 { dg-skip-if PR119692 { ! openacc_host_selected } } */
6 /* { dg-additional-options -fdump-tree-gimple } */
7
8 /* See also '../libgomp.c++/pr119692-1-1.C'. */
9
10 /* See also '../../../gcc/testsuite/g++.target/gcn/pr119692-1-1.C',
11 '../../../gcc/testsuite/g++.target/nvptx/pr119692-1-1.C'. */
12
13 #ifndef DEFAULT
14 # define DEFAULT
15 #endif
16
17 struct C1
18 {
19 virtual void f()
20 {}
21 };
22
23 struct C2 : C1
24 {
25 };
26
27 int main()
28 {
29 #pragma omp target DEFAULT
30 #pragma acc serial DEFAULT
31 /* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } .-1 } */
32 {
33 C1 c1;
34 C1 *c1p = &c1;
35 asm volatile ("" : : "r" (&c1p) : "memory");
36 C2 *c2 = dynamic_cast<C2 *>(c1p);
37 if (c2)
38 __builtin_abort();
39 }
40 }
41
42 /* { dg-final { scan-tree-dump-not {(?n)#pragma omp target oacc_serial map\(tofrom:_ZTI2C2 \[len: [0-9]+\]\) map\(tofrom:_ZTI2C1 \[len: [0-9]+\]\) map\(tofrom:_ZTV2C1 \[len: [0-9]+\]\)$} gimple { xfail *-*-* } } } */