37 lines · plain
1; This test is to ensure that OpExtInst generated by NonSemantic_Shader_DebugInfo_1002; are not mixed up with other OpExtInst instructions.3; The code of the test is a reproducer, because "lgamma" has the same code (35)4; inside OpenCL_std as DebugSource inside NonSemantic_Shader_DebugInfo_100.5 6; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s7; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}8 9; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s10; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}11 12; CHECK: %[[#Ocl:]] = OpExtInstImport "OpenCL.std"13; CHECK: OpName %[[#Fun:]] "__devicelib_lgammaf"14; CHECK: %[[#Fun]] = OpFunction %[[#]] None %[[#]]15; CHECK: OpFunctionParameter16; CHECK: %[[#]] = OpExtInst %[[#]] %[[#Ocl]] lgamma %[[#]]17 18define weak_odr dso_local spir_kernel void @foo() {19entry:20 %r = tail call spir_func noundef float @lgammaf(float noundef 0x7FF8000000000000)21 ret void22}23 24define weak dso_local spir_func float @lgammaf(float noundef %x) {25entry:26 %call = tail call spir_func float @__devicelib_lgammaf(float noundef %x)27 ret float %call28}29 30define weak dso_local spir_func float @__devicelib_lgammaf(float noundef %x) {31entry:32 %call = tail call spir_func noundef float @_Z18__spirv_ocl_lgammaf(float noundef %x)33 ret float %call34}35 36declare dso_local spir_func noundef float @_Z18__spirv_ocl_lgammaf(float noundef)37