annotate clang/test/CodeGenCUDA/noinline.cu @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
1 // Uses -O2 since the defalt -O0 option adds noinline to all functions.
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
2
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
3 // RUN: %clang_cc1 -triple nvptx-nvidia-cuda -fcuda-is-device \
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
4 // RUN: -O2 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
5
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
6 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device \
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
7 // RUN: -O2 -disable-llvm-passes -emit-llvm -o - -x hip %s | FileCheck %s
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
8
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
9 // RUN: %clang_cc1 -triple x86_64-unknown-gnu-linux \
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
10 // RUN: -O2 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
11
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
12 #include "Inputs/cuda.h"
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
13
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
14 __noinline__ __device__ __host__ void fun1() {}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
15
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
16 __attribute__((noinline)) __device__ __host__ void fun2() {}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
17
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
18 __attribute__((__noinline__)) __device__ __host__ void fun3() {}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
19
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
20 [[gnu::__noinline__]] __device__ __host__ void fun4() {}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
21
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
22 #define __noinline__ __attribute__((__noinline__))
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
23 __noinline__ __device__ __host__ void fun5() {}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
24
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
25 __device__ __host__ void fun6() {}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
26
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
27 // CHECK: define{{.*}}@_Z4fun1v{{.*}}#[[ATTR1:[0-9]*]]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
28 // CHECK: define{{.*}}@_Z4fun2v{{.*}}#[[ATTR1:[0-9]*]]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
29 // CHECK: define{{.*}}@_Z4fun3v{{.*}}#[[ATTR1:[0-9]*]]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
30 // CHECK: define{{.*}}@_Z4fun4v{{.*}}#[[ATTR1:[0-9]*]]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
31 // CHECK: define{{.*}}@_Z4fun5v{{.*}}#[[ATTR1:[0-9]*]]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
32 // CHECK: define{{.*}}@_Z4fun6v{{.*}}#[[ATTR2:[0-9]*]]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
33 // CHECK: attributes #[[ATTR1]] = {{.*}}noinline
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
34 // CHECK-NOT: attributes #[[ATTR2]] = {{.*}}noinline