1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // The hd function template is instantiated three times.
5 // Two of those instantiations call a device function, which is an error when
6 // compiling for host. Clang should report both errors.
8 #include "Inputs/cuda.h"
14 struct Selector<int> {
19 struct Selector<float> {
20 __device__ void f() {} // expected-note {{declared here}}
24 struct Selector<double> {
25 __device__ void f() {} // expected-note {{declared here}}
29 inline __host__ __device__ void hd() {
31 // expected-error@-1 2 {{reference to __device__ function}}
37 // expected-note@-1 {{called by 'host_fn'}}
39 // expected-note@-1 {{called by 'host_fn'}}