1 ; The goal of the test case is to ensure that if module contains functions with mutated signature
2 ; (due to preprocessing of aggregate types), functions still are going through re-creating of
3 ; function type to preserve pointee type information for arguments.
5 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
6 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
8 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
9 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
11 ; CHECK-DAG: %[[#Int8:]] = OpTypeInt 8 0
12 ; CHECK-DAG: %[[#Half:]] = OpTypeFloat 16
13 ; CHECK-DAG: %[[#Struct:]] = OpTypeStruct %[[#Half]]
14 ; CHECK-DAG: %[[#Void:]] = OpTypeVoid
15 ; CHECK-DAG: %[[#PtrInt8:]] = OpTypePointer CrossWorkgroup %[[#Int8:]]
16 ; CHECK-DAG: %[[#FooType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt8]] %[[#Struct]]
17 ; CHECK-DAG: %[[#Int64:]] = OpTypeInt 64 0
18 ; CHECK-DAG: %[[#PtrInt64:]] = OpTypePointer CrossWorkgroup %[[#Int64]]
19 ; CHECK-DAG: %[[#BarType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt64]] %[[#Struct]]
20 ; CHECK: OpFunction %[[#Void]] None %[[#FooType]]
21 ; CHECK: OpFunctionParameter %[[#PtrInt8]]
22 ; CHECK: OpFunctionParameter %[[#Struct]]
23 ; CHECK: OpFunction %[[#Void]] None %[[#BarType]]
24 ; CHECK: OpFunctionParameter %[[#PtrInt64]]
25 ; CHECK: OpFunctionParameter %[[#Struct]]
27 %t_half = type { half }
29 define spir_kernel void @foo(ptr addrspace(1) %a, %t_half %b) {
35 define spir_kernel void @bar(ptr addrspace(1) %a, %t_half %b) {
37 %r = getelementptr inbounds i64, ptr addrspace(1) %a, i64 0
41 declare spir_func %t_half @_Z29__spirv_SpecConstantComposite(half)