1 // expected-no-diagnostics
3 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
4 // RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only -fcuda-is-device -verify %s
6 #include "Inputs/cuda.h"
8 __host__ void overload() {}
9 __device__ void overload() {}
11 __host__ __device__ void test_hd() {
12 // This should not be ambiguous -- we choose the host or the device overload
13 // depending on whether or not we're compiling for host or device.
14 void (*x)() = overload;
17 // These also shouldn't be ambiguous, but they're an easier test than the HD
19 __host__ void test_host() {
20 void (*x)() = overload;
22 __device__ void test_device() {
23 void (*x)() = overload;