1 ; Libdevice in recent CUDA versions relies on __CUDA_ARCH reflecting GPU type.
2 ; Verify that __nvvm_reflect() is replaced with an appropriate value.
4 ; RUN: opt %s -S -nvvm-reflect -O2 -mtriple=nvptx64 \
5 ; RUN: | FileCheck %s --check-prefixes=COMMON,SM20
6 ; RUN: opt %s -S -nvvm-reflect -O2 -mtriple=nvptx64 -mcpu=sm_35 \
7 ; RUN: | FileCheck %s --check-prefixes=COMMON,SM35
9 @"$str" = private addrspace(1) constant [12 x i8] c"__CUDA_ARCH\00"
11 declare i32 @__nvvm_reflect(i8*)
14 define i32 @foo(float %a, float %b) {
15 ; COMMON-NOT: call i32 @__nvvm_reflect
16 %reflect = call i32 @__nvvm_reflect(i8* addrspacecast (i8 addrspace(1)* getelementptr inbounds ([12 x i8], [12 x i8] addrspace(1)* @"$str", i32 0, i32 0) to i8*))