• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -emit-pch %s -o %t
2 // RUN: %clang_cc1 -verify -verify-ignore-unexpected=note -include-pch %t -fsyntax-only %s
3 
4 #ifndef HEADER
5 #define HEADER
6 
7 #pragma clang force_cuda_host_device begin
8 #pragma clang force_cuda_host_device begin
9 #pragma clang force_cuda_host_device end
10 
hd1()11 void hd1() {}
12 
13 #else
14 
hd2()15 void hd2() {}
16 
17 #pragma clang force_cuda_host_device end
18 
host_only()19 void host_only() {}
20 
device()21 __attribute__((device)) void device() {
22   hd1();
23   hd2();
24   host_only(); // expected-error {{no matching function for call}}
25 }
26 
27 #endif
28