llvm-project
24 строки · 706.0 Байт
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.
14void (*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() {
20void (*x)() = overload;
21}
22__device__ void test_device() {
23void (*x)() = overload;
24}
25