Handle symbol visibility/locality for PIE/PIC
[official-gcc.git] / gcc / testsuite / c-c++-common / goacc / acc_on_device-2.c
blobd5389a99072ccad0f14ed34f3393e499f173c525
1 /* Have to enable optimizations, as otherwise builtins won't be expanded. */
2 /* { dg-additional-options "-O -fdump-rtl-expand" } */
4 #if __cplusplus
5 extern "C" {
6 #endif
8 typedef enum acc_device_t { acc_device_X = 123 } acc_device_t;
9 extern int acc_on_device (acc_device_t);
11 #if __cplusplus
13 #endif
15 int
16 f (void)
18 const acc_device_t dev = acc_device_X;
19 return acc_on_device (dev);
22 /* With -fopenacc, we're expecting the builtin to be expanded, so no calls.
23 TODO: in C++, even under extern "C", the use of enum for acc_device_t
24 perturbs expansion as a builtin, which expects an int parameter. It's fine
25 when changing acc_device_t to plain int, but that's not what we're doing in
26 <openacc.h>.
27 { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 0 "expand" { xfail c++ } } } */
29 /* { dg-final { cleanup-rtl-dump "expand" } } */