21 lines · plain
1; Libdevice in recent CUDA versions relies on __CUDA_ARCH reflecting GPU type.2; Verify that __nvvm_reflect() is replaced with an appropriate value.3;4; RUN: opt %s -S -passes='default<O2>' -mtriple=nvptx64 -mcpu=sm_20 \5; RUN: | FileCheck %s --check-prefixes=COMMON,SM206; RUN: opt %s -S -passes='default<O2>' -mtriple=nvptx64 -mcpu=sm_35 \7; RUN: | FileCheck %s --check-prefixes=COMMON,SM358 9@"$str" = private addrspace(1) constant [12 x i8] c"__CUDA_ARCH\00"10 11declare i32 @__nvvm_reflect(ptr)12 13; COMMON-LABEL: @foo14define i32 @foo(float %a, float %b) {15; COMMON-NOT: call i32 @__nvvm_reflect16 %reflect = call i32 @__nvvm_reflect(ptr addrspacecast (ptr addrspace(1) @"$str" to ptr))17; SM20: ret i32 200 18; SM35: ret i32 350 19 ret i32 %reflect20}21