Debian Codegraph @

gcc/testsuite/g++.dg/gomp/map-ternary-1.C

raw
1 // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } }
2
3 #include <cassert>
4
5 int foo (bool yesno)
6 {
7 int x = 5, y = 7;
8 #pragma omp target map(yesno ? x : y)
9 /* { dg-message {sorry, unimplemented: unsupported map expression '\(yesno \? x : y\)'} "" { target *-*-* } .-1 } */
10 {
11 x += 3;
12 y += 5;
13 }
14 return yesno ? x : y;
15 }
16
17 int main (int argc, char *argv[])
18 {
19 assert (foo (true) == 8);
20 assert (foo (false) == 12);
21 return 0;
22 }