1 // expected-no-diagnostics
2 
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
5 
6 #include "Inputs/cuda.h"
7 
overload()8 __host__ void overload() {}
overload()9 __device__ void overload() {}
10 
test_hd()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;
15 }
16 
17 // These also shouldn't be ambiguous, but they're an easier test than the HD
18 // function above.
test_host()19 __host__ void test_host() {
20   void (*x)() = overload;
21 }
test_device()22 __device__ void test_device() {
23   void (*x)() = overload;
24 }
25