1 // RUN: %clang_cc1 %s --std=c++11 -triple x86_64-linux-unknown -fsyntax-only -o - -verify
3 #include "Inputs/cuda.h"
5 // Check that we get an error if we try to call a __device__ function from a
10 // expected-note@-1 {{'S' declared here}}
14 // expected-error@-1 {{reference to __device__ function 'S' in global initializer}}
17 __host__ __device__ T() {}
19 T t; // No error, this is OK.
24 // expected-note@-1 {{'U' declared here}}
27 // expected-error@-1 {{reference to __device__ function 'U' in global initializer}}
29 __device__ int device_fn() { return 42; }
30 // expected-note@-1 {{'device_fn' declared here}}
32 // expected-error@-1 {{reference to __device__ function 'device_fn' in global initializer}}