| 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 | |
| 11 | void hd1() {} |
| 12 | |
| 13 | #else |
| 14 | |
| 15 | void hd2() {} |
| 16 | |
| 17 | #pragma clang force_cuda_host_device end |
| 18 | |
| 19 | void host_only() {} |
| 20 | |
| 21 | __attribute__((device)) void device() { |
| 22 | hd1(); |
| 23 | hd2(); |
| 24 | host_only(); // expected-error {{no matching function for call}} |
| 25 | } |
| 26 | |
| 27 | #endif |
| 28 | |