1 // RUN: %clang_cc1 -std=c++11 -triple nvptx64-nvidia-cuda -fsyntax-only \
2 // RUN: -fcuda-is-device -verify=dev %s
3 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fsyntax-only \
4 // RUN: -verify=host %s
8 #include "Inputs/cuda.h"
11 A(); // dev-note 2{{'A' declared here}}
14 template <class T, int x> struct B {
16 constexpr B() = default; // dev-error 2{{reference to __host__ function 'A' in __host__ __device__ function}}
19 __host__ void f() { B<A, 1> x; }
20 __device__ void f() { B<A, 1> x; } // dev-note{{called by 'f'}}
23 __host__ foo() { B<A, 2> x; }
24 __device__ foo() { B<A, 2> x; } // dev-note{{called by 'foo'}}
27 __host__ void g() { foo x; }
28 __device__ void g() { foo x; } // dev-note{{called by 'g'}}
31 __host__ bar() { B<A, 3> x; }
32 __device__ bar() { B<A, 3> x; } // no error since no instantiation of bar