brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 41e8231 Raw
35 lines · plain
1// Uses -O2 since the defalt -O0 option adds noinline to all functions.2 3// RUN: %clang_cc1 -triple nvptx-nvidia-cuda -fcuda-is-device \4// RUN:     -O2 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s5 6// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device \7// RUN:     -O2 -disable-llvm-passes -emit-llvm -o - -x hip %s | FileCheck %s8 9// RUN: %clang_cc1 -triple x86_64-unknown-gnu-linux \10// RUN:     -O2 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s11 12#include "Inputs/cuda.h"13 14__noinline__ __device__ __host__ void fun1() {}15 16__attribute__((noinline)) __device__ __host__ void fun2() {}17 18__attribute__((__noinline__)) __device__ __host__ void fun3() {}19 20[[gnu::__noinline__]] __device__ __host__ void fun4() {}21 22#define __noinline__ __attribute__((__noinline__))23__noinline__ __device__ __host__ void fun5() {}24 25__device__ __host__ void fun6() {}26 27// CHECK: define{{.*}}@_Z4fun1v{{.*}}#[[ATTR1:[0-9]*]]28// CHECK: define{{.*}}@_Z4fun2v{{.*}}#[[ATTR1:[0-9]*]]29// CHECK: define{{.*}}@_Z4fun3v{{.*}}#[[ATTR1:[0-9]*]]30// CHECK: define{{.*}}@_Z4fun4v{{.*}}#[[ATTR1:[0-9]*]]31// CHECK: define{{.*}}@_Z4fun5v{{.*}}#[[ATTR1:[0-9]*]]32// CHECK: define{{.*}}@_Z4fun6v{{.*}}#[[ATTR2:[0-9]*]]33// CHECK: attributes #[[ATTR1]] = {{.*}}noinline34// CHECK-NOT: attributes #[[ATTR2]] = {{.*}}noinline35