| 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 |
|
| 8 |
__host__ void overload() {} |
| 9 |
__device__ void overload() {} |
| 10 |
|
| 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. |
| 19 |
__host__ void test_host() { |
| 20 |
void (*x)() = overload; |
| 21 |
} |
| 22 |
__device__ void test_device() { |
| 23 |
void (*x)() = overload; |
| 24 |
} |