brintos

brintos / llvm-project-archived public Read only

0
0
Text · 802 B · be4c5fe Raw
24 lines · plain
1// RUN: %clang_cc1 -x hip -emit-llvm -std=c++11 %s -o - \2// RUN:   -triple x86_64-linux-gnu \3// RUN:   | FileCheck -check-prefix=HOST %s4// RUN: %clang_cc1 -x hip -emit-llvm -std=c++11 %s -o - \5// RUN:   -triple amdgcn-amd-amdhsa -fcuda-is-device \6// RUN:   | FileCheck -check-prefix=DEV %s7 8#include "Inputs/cuda.h"9 10// Checks noinline is correctly added to the lambda function.11 12// HOST: define{{.*}}@_ZZ4HostvENKUlvE_clEv({{.*}}) #[[ATTR:[0-9]+]]13// HOST: attributes #[[ATTR]]{{.*}}noinline14 15// DEV: define{{.*}}@_ZZ6DevicevENKUlvE_clEv({{.*}}) #[[ATTR:[0-9]+]]16// DEV: attributes #[[ATTR]]{{.*}}noinline17 18__device__ int a;19int b;20 21__device__ int Device() { return ([&] __device__ __noinline__ (){ return a; })(); }22 23__host__ int Host() { return ([&] __host__ __noinline__ (){ return b; })(); }24