brintos

brintos / llvm-project-archived public Read only

0
0
Text · 706 B · 03c7f7c Raw
25 lines · plain
1// expected-no-diagnostics2 3// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s4// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only -fcuda-is-device -verify %s5 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 overload13  // 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 HD18// function above.19__host__ void test_host() {20  void (*x)() = overload;21}22__device__ void test_device() {23  void (*x)() = overload;24}25