Skip to content

Commit 1621c00

Browse files
committed
[Tests] Be consistent w/definition of statepoint-example
These tests use the statepoint-example builtin gc which expects address space #1 to the only non-integral address space. The fact the test used as=0 happened to work, but was caught by a downstream assert. (Literally years ago, I just happened to notice the XFAIL and fix it now.)
1 parent 6b21054 commit 1621c00

File tree

2 files changed

+129
-129
lines changed

2 files changed

+129
-129
lines changed

llvm/test/CodeGen/Generic/overloaded-intrinsic-name.ll

+40-40
Original file line numberDiff line numberDiff line change
@@ -12,75 +12,75 @@
1212
; will serve the purpose.
1313

1414
; function and integer
15-
define i32* @test_iAny(i32* %v) gc "statepoint-example" {
16-
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32* %v)]
17-
%v-new = call i32* @llvm.experimental.gc.relocate.p0i32(token %tok, i32 0, i32 0)
18-
ret i32* %v-new
15+
define i32 addrspace(1)* @test_iAny(i32 addrspace(1)* %v) gc "statepoint-example" {
16+
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32 addrspace(1)* %v)]
17+
%v-new = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token %tok, i32 0, i32 0)
18+
ret i32 addrspace(1)* %v-new
1919
}
2020

2121
; float
22-
define float* @test_fAny(float* %v) gc "statepoint-example" {
23-
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(float* %v)]
24-
%v-new = call float* @llvm.experimental.gc.relocate.p0f32(token %tok, i32 0, i32 0)
25-
ret float* %v-new
22+
define float addrspace(1)* @test_fAny(float addrspace(1)* %v) gc "statepoint-example" {
23+
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(float addrspace(1)* %v)]
24+
%v-new = call float addrspace(1)* @llvm.experimental.gc.relocate.p1f32(token %tok, i32 0, i32 0)
25+
ret float addrspace(1)* %v-new
2626
}
2727

2828
; array of integers
29-
define [3 x i32]* @test_aAny([3 x i32]* %v) gc "statepoint-example" {
30-
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"([3 x i32]* %v)]
31-
%v-new = call [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(token %tok, i32 0, i32 0)
32-
ret [3 x i32]* %v-new
29+
define [3 x i32] addrspace(1)* @test_aAny([3 x i32] addrspace(1)* %v) gc "statepoint-example" {
30+
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"([3 x i32] addrspace(1)* %v)]
31+
%v-new = call [3 x i32] addrspace(1)* @llvm.experimental.gc.relocate.p1a3i32(token %tok, i32 0, i32 0)
32+
ret [3 x i32] addrspace(1)* %v-new
3333
}
3434

3535
; vector of integers
36-
define <3 x i32>* @test_vAny(<3 x i32>* %v) gc "statepoint-example" {
37-
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(<3 x i32>* %v)]
38-
%v-new = call <3 x i32>* @llvm.experimental.gc.relocate.p0v3i32(token %tok, i32 0, i32 0)
39-
ret <3 x i32>* %v-new
36+
define <3 x i32> addrspace(1)* @test_vAny(<3 x i32> addrspace(1)* %v) gc "statepoint-example" {
37+
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(<3 x i32> addrspace(1)* %v)]
38+
%v-new = call <3 x i32> addrspace(1)* @llvm.experimental.gc.relocate.p1v3i32(token %tok, i32 0, i32 0)
39+
ret <3 x i32> addrspace(1)* %v-new
4040
}
4141

4242
%struct.test = type { i32, i1 }
4343

4444
; struct
45-
define %struct.test* @test_struct(%struct.test* %v) gc "statepoint-example" {
46-
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(%struct.test* %v)]
47-
%v-new = call %struct.test* @llvm.experimental.gc.relocate.p0s_struct.tests(token %tok, i32 0, i32 0)
48-
ret %struct.test* %v-new
45+
define %struct.test addrspace(1)* @test_struct(%struct.test addrspace(1)* %v) gc "statepoint-example" {
46+
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(%struct.test addrspace(1)* %v)]
47+
%v-new = call %struct.test addrspace(1)* @llvm.experimental.gc.relocate.p1s_struct.tests(token %tok, i32 0, i32 0)
48+
ret %struct.test addrspace(1)* %v-new
4949
}
5050

5151
; literal struct with nested literal struct
52-
define {i64, i64, {i64} }* @test_literal_struct({i64, i64, {i64}}* %v) gc "statepoint-example" {
53-
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"({i64, i64, {i64}} *%v)]
54-
%v-new = call {i64, i64, {i64}}* @llvm.experimental.gc.relocate.p0sl_i64i64sl_i64ss.test(token %tok, i32 0, i32 0)
55-
ret {i64, i64, {i64}}* %v-new
52+
define {i64, i64, {i64} } addrspace(1)* @test_literal_struct({i64, i64, {i64}} addrspace(1)* %v) gc "statepoint-example" {
53+
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"({i64, i64, {i64}} addrspace(1)* %v)]
54+
%v-new = call {i64, i64, {i64}} addrspace(1)* @llvm.experimental.gc.relocate.p1sl_i64i64sl_i64ss.test(token %tok, i32 0, i32 0)
55+
ret {i64, i64, {i64}} addrspace(1)* %v-new
5656
}
5757
; struct with a horrible name, broken when structs were unprefixed
5858
%i32 = type { i32 }
5959

60-
define %i32* @test_i32_struct(%i32* %v) gc "statepoint-example" {
60+
define %i32 addrspace(1)* @test_i32_struct(%i32 addrspace(1)* %v) gc "statepoint-example" {
6161
entry:
62-
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(%i32* %v)]
63-
%v-new = call %i32* @llvm.experimental.gc.relocate.p0s_i32s(token %tok, i32 0, i32 0)
64-
ret %i32* %v-new
62+
%tok = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(%i32 addrspace(1)* %v)]
63+
%v-new = call %i32 addrspace(1)* @llvm.experimental.gc.relocate.p1s_i32s(token %tok, i32 0, i32 0)
64+
ret %i32 addrspace(1)* %v-new
6565
}
6666
; completely broken intrinsic naming due to needing remangling. Just use random naming to test
6767

68-
define %i32* @test_broken_names(%i32* %v) gc "statepoint-example" {
68+
define %i32 addrspace(1)* @test_broken_names(%i32 addrspace(1)* %v) gc "statepoint-example" {
6969
entry:
70-
%tok = call fastcc token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.deadbeef(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(%i32* %v)]
70+
%tok = call fastcc token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.deadbeef(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(%i32 addrspace(1)* %v)]
7171
; Make sure we do not destroy the calling convention when remangling
7272
; CHECK: fastcc
73-
%v-new = call %i32* @llvm.experimental.gc.relocate.beefdead(token %tok, i32 0, i32 0)
74-
ret %i32* %v-new
73+
%v-new = call %i32 addrspace(1)* @llvm.experimental.gc.relocate.beefdead(token %tok, i32 0, i32 0)
74+
ret %i32 addrspace(1)* %v-new
7575
}
7676
declare zeroext i1 @return_i1()
7777
declare token @llvm.experimental.gc.statepoint.p0f_i1f(i64, i32, i1 ()*, i32, i32, ...)
78-
declare i32* @llvm.experimental.gc.relocate.p0i32(token, i32, i32)
79-
declare float* @llvm.experimental.gc.relocate.p0f32(token, i32, i32)
80-
declare [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(token, i32, i32)
81-
declare <3 x i32>* @llvm.experimental.gc.relocate.p0v3i32(token, i32, i32)
82-
declare %struct.test* @llvm.experimental.gc.relocate.p0s_struct.tests(token, i32, i32)
83-
declare {i64, i64, {i64}}* @llvm.experimental.gc.relocate.p0sl_i64i64sl_i64ss.test(token, i32, i32)
84-
declare %i32* @llvm.experimental.gc.relocate.p0s_i32s(token, i32, i32)
85-
declare %i32* @llvm.experimental.gc.relocate.beefdead(token, i32, i32)
78+
declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token, i32, i32)
79+
declare float addrspace(1)* @llvm.experimental.gc.relocate.p1f32(token, i32, i32)
80+
declare [3 x i32] addrspace(1)* @llvm.experimental.gc.relocate.p1a3i32(token, i32, i32)
81+
declare <3 x i32> addrspace(1)* @llvm.experimental.gc.relocate.p1v3i32(token, i32, i32)
82+
declare %struct.test addrspace(1)* @llvm.experimental.gc.relocate.p1s_struct.tests(token, i32, i32)
83+
declare {i64, i64, {i64}} addrspace(1)* @llvm.experimental.gc.relocate.p1sl_i64i64sl_i64ss.test(token, i32, i32)
84+
declare %i32 addrspace(1)* @llvm.experimental.gc.relocate.p1s_i32s(token, i32, i32)
85+
declare %i32 addrspace(1)* @llvm.experimental.gc.relocate.beefdead(token, i32, i32)
8686
declare token @llvm.experimental.gc.statepoint.deadbeef(i64, i32, i1 ()*, i32, i32, ...)

0 commit comments

Comments
 (0)