| 1 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \ |
| 2 |
// RUN: -isystem %S/Inputs -verify %s |
| 3 |
// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only \ |
| 4 |
// RUN: -isystem %S/Inputs -fcuda-is-device -verify %s |
| 5 |
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \ |
| 6 |
// RUN: -isystem %S/Inputs -verify=redecl -Wnvcc-compat %s |
| 7 |
// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only \ |
| 8 |
// RUN: -isystem %S/Inputs -fcuda-is-device -Wnvcc-compat -verify=redecl %s |
| 9 |
|
| 10 |
// expected-no-diagnostics |
| 11 |
#include "cuda.h" |
| 12 |
|
| 13 |
__device__ void f(); // redecl-note {{previous declaration is here}} |
| 14 |
|
| 15 |
void f() {} // redecl-warning {{target-attribute based function overloads are not supported by NVCC and will be treated as a function redeclaration:new declaration is __host__ function, old declaration is __device__ function}} |
| 16 |
|
| 17 |
void g(); // redecl-note {{previous declaration is here}} |
| 18 |
|
| 19 |
__device__ void g() {} // redecl-warning {{target-attribute based function overloads are not supported by NVCC and will be treated as a function redeclaration:new declaration is __device__ function, old declaration is __host__ function}} |