llvm-project/clang/test/CodeGenHipStdPar/unannotated-functions-get-emitted.cpp
Alex Voicu 791b890c46 [HIP][Clang][CodeGen] Simplify test for hipstdpar
Fixes build failures for cases where there's no additional visibility / linkage spec.

Differential Revision: https://reviews.llvm.org/D155850
2023-10-17 15:42:28 +01:00

20 lines
586 B
C++

// RUN: %clang_cc1 -x hip -emit-llvm -fcuda-is-device \
// RUN: -o - %s | FileCheck --check-prefix=NO-HIPSTDPAR-DEV %s
// RUN: %clang_cc1 --hipstdpar -emit-llvm -fcuda-is-device \
// RUN: -o - %s | FileCheck --check-prefix=HIPSTDPAR-DEV %s
#define __device__ __attribute__((device))
// NO-HIPSTDPAR-DEV-NOT: {{.*}}void @foo({{.*}})
// HIPSTDPAR-DEV: {{.*}}void @foo({{.*}})
extern "C" void foo(float *a, float b) {
*a = b;
}
// NO-HIPSTDPAR-DEV: {{.*}}void @bar({{.*}})
// HIPSTDPAR-DEV: {{.*}}void @bar({{.*}})
extern "C" __device__ void bar(float *a, float b) {
*a = b;
}