56 lines · plain
1; The goal of the test case is to ensure that if module contains functions with mutated signature2; (due to preprocessing of aggregate types), functions still are going through re-creating of3; function type to preserve pointee type information for arguments.4 5; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s6; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}7 8; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s9; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}10 11; CHECK-DAG: %[[#Int8:]] = OpTypeInt 8 012; CHECK-DAG: %[[#Half:]] = OpTypeFloat 1613; CHECK-DAG: %[[#Float:]] = OpTypeFloat 3214; CHECK-DAG: %[[#Struct:]] = OpTypeStruct %[[#Half]]15; CHECK-DAG: %[[#Void:]] = OpTypeVoid16; CHECK-DAG: %[[#PtrInt8:]] = OpTypePointer CrossWorkgroup %[[#Int8:]]17; CHECK-DAG: %[[#FooType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt8]] %[[#Struct]]18; CHECK-DAG: %[[#Int64:]] = OpTypeInt 64 019; CHECK-DAG: %[[#PtrInt64:]] = OpTypePointer CrossWorkgroup %[[#Int64]]20; CHECK-DAG: %[[#BarType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt64]] %[[#Struct]]21; CHECK-DAG: %[[#BazType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt8]] %[[#Struct]] %[[#Int8]] %[[#Struct]] %[[#Float]] %[[#Struct]]22; CHECK: OpFunction %[[#Void]] None %[[#FooType]]23; CHECK: OpFunctionParameter %[[#PtrInt8]]24; CHECK: OpFunctionParameter %[[#Struct]]25; CHECK: OpFunction %[[#Void]] None %[[#BarType]]26; CHECK: OpFunctionParameter %[[#PtrInt64]]27; CHECK: OpFunctionParameter %[[#Struct]]28; CHECK: OpFunction %[[#Void]] None %[[#BazType]]29; CHECK: OpFunctionParameter %[[#PtrInt8]]30; CHECK: OpFunctionParameter %[[#Struct]]31; CHECK: OpFunctionParameter %[[#Int8]]32; CHECK: OpFunctionParameter %[[#Struct]]33; CHECK: OpFunctionParameter %[[#Float]]34; CHECK: OpFunctionParameter %[[#Struct]]35 36%t_half = type { half }37 38define spir_kernel void @foo(ptr addrspace(1) %a, %t_half %b) {39entry:40 ret void41}42 43 44define spir_kernel void @bar(ptr addrspace(1) %a, %t_half %b) {45entry:46 %r = getelementptr inbounds i64, ptr addrspace(1) %a, i64 047 ret void48}49 50define spir_kernel void @baz(ptr addrspace(1) %a, %t_half %b, i8 %c, %t_half %d, float %e, %t_half %f) {51entry:52 ret void53}54 55declare spir_func %t_half @_Z29__spirv_SpecConstantComposite(half)56