Skip to content

Commit 5da0007

Browse files
authored
[CIR][NFC] Fix mismatch of argument type in IR tests (#837)
There is a typo in `call.cir` that uses a wrong function argument type, leading to failure in the final LLVM IR translation. CIR verification does not reject it, because it skips indirect calls at the beginning. It's `verifySymbolUses` after all. https://github.com/llvm/clangir/blob/bde154cf1243cc4f938339c4dc15b1576d3025ab/clang/lib/CIR/Dialect/IR/CIRDialect.cpp#L2672-L2679 The typo was copied to another IR test. Here we fix them all.
1 parent 7c24e59 commit 5da0007

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/test/CIR/IR/call-op-call-conv.cir

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: FileCheck --input-file=%t.cir %s
33

44
!s32i = !cir.int<s, 32>
5-
!fnptr = !cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>
5+
!fnptr = !cir.ptr<!cir.func<!s32i (!s32i)>>
66

77
module {
88
cir.func @my_add(%a: !s32i, %b: !s32i) -> !s32i cc(spir_function) {
@@ -22,6 +22,6 @@ module {
2222
}
2323
}
2424

25-
// CHECK: %{{[0-9]+}} = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>, !s32i) -> !s32i cc(spir_kernel)
26-
// CHECK: %{{[0-9]+}} = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>, !s32i) -> !s32i cc(spir_function)
25+
// CHECK: %{{[0-9]+}} = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!s32i)>>, !s32i) -> !s32i cc(spir_kernel)
26+
// CHECK: %{{[0-9]+}} = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!s32i)>>, !s32i) -> !s32i cc(spir_function)
2727
// CHECK: %{{[0-9]+}} = cir.try_call @my_add(%{{[0-9]+}}, %{{[0-9]+}}) ^{{.+}}, ^{{.+}} : (!s32i, !s32i) -> !s32i cc(spir_function)

clang/test/CIR/IR/call.cir

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: cir-opt %s | FileCheck %s
22

33
!s32i = !cir.int<s, 32>
4-
!fnptr = !cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>
4+
!fnptr = !cir.ptr<!cir.func<!s32i (!s32i)>>
55

66
#fn_attr = #cir<extra({inline = #cir.inline<no>, optnone = #cir.optnone})>
77
#fn_attr1 = #cir<extra({nothrow = #cir.nothrow})>
@@ -20,5 +20,5 @@ module {
2020
}
2121
}
2222

23-
// CHECK: %0 = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!cir.ptr<!s32i>)>>, !s32i) -> !s32i
23+
// CHECK: %0 = cir.call %arg0(%arg1) : (!cir.ptr<!cir.func<!s32i (!s32i)>>, !s32i) -> !s32i
2424
// CHECK: %1 = cir.call @_ZNSt5arrayIiLm8192EEixEm(%arg1) : (!s32i) -> !s32i extra(#fn_attr1)

0 commit comments

Comments
 (0)