1*0419465fSNikita Popov // RUN: %clang_cc1 -x hip -emit-llvm -std=c++11 %s -o - \ 2c05f1639SPierre van Houtryve // RUN: -triple x86_64-linux-gnu \ 3c05f1639SPierre van Houtryve // RUN: | FileCheck -check-prefix=HOST %s 4*0419465fSNikita Popov // RUN: %clang_cc1 -x hip -emit-llvm -std=c++11 %s -o - \ 5c05f1639SPierre van Houtryve // RUN: -triple amdgcn-amd-amdhsa -fcuda-is-device \ 6c05f1639SPierre van Houtryve // RUN: | FileCheck -check-prefix=DEV %s 7c05f1639SPierre van Houtryve 8c05f1639SPierre van Houtryve #include "Inputs/cuda.h" 9c05f1639SPierre van Houtryve 10c05f1639SPierre van Houtryve // Checks noinline is correctly added to the lambda function. 11c05f1639SPierre van Houtryve 12c05f1639SPierre van Houtryve // HOST: define{{.*}}@_ZZ4HostvENKUlvE_clEv({{.*}}) #[[ATTR:[0-9]+]] 13c05f1639SPierre van Houtryve // HOST: attributes #[[ATTR]]{{.*}}noinline 14c05f1639SPierre van Houtryve 15c05f1639SPierre van Houtryve // DEV: define{{.*}}@_ZZ6DevicevENKUlvE_clEv({{.*}}) #[[ATTR:[0-9]+]] 16c05f1639SPierre van Houtryve // DEV: attributes #[[ATTR]]{{.*}}noinline 17c05f1639SPierre van Houtryve 18c05f1639SPierre van Houtryve __device__ int a; 19c05f1639SPierre van Houtryve int b; 20c05f1639SPierre van Houtryve Device()21c05f1639SPierre van Houtryve__device__ int Device() { return ([&] __device__ __noinline__ (){ return a; })(); } 22c05f1639SPierre van Houtryve Host()23c05f1639SPierre van Houtryve__host__ int Host() { return ([&] __host__ __noinline__ (){ return b; })(); } 24