aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenHipStdPar/unannotated-functions-get-emitted.cpp
blob: dfd6b3da0a291b136f13112d7565216c2a5c638a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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;
}