Skip to content

Commit c84273c

Browse files
committed
Rework and rename test case
1 parent cd65d49 commit c84273c

File tree

1 file changed

+81
-57
lines changed

1 file changed

+81
-57
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,144 @@
1-
; REQUIRES: asserts
2-
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 -o - %s 2>&1 | FileCheck %s
1+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 < %s | FileCheck %s
32

4-
; CHECK-NOT: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' failed
3+
; Previously, this would hit an assertion on incompatible comparison between
4+
; APInts due to BitWidth differences. This was due to assignment of DenseMap
5+
; value using another value within that same DenseMap which results in a
6+
; use-after-free if the assignment operator invokes a DenseMap growth.
57

6-
define void @RunTic() {
7-
%call5.i1 = call i32 @G_CheckDemoStatus()
8-
tail call void @D_AdvanceDemo()
9-
call void @G_Ticker()
8+
; CHECK-LABEL: I_Quit:
9+
define void @I_Quit() {
10+
%fptr = load ptr, ptr null, align 8
11+
tail call void %fptr()
1012
ret void
1113
}
1214

13-
define void @G_Ticker() {
14-
call void @G_DoReborn()
15-
tail call void @F_Ticker()
16-
tail call void @AM_Stop()
17-
tail call void @F_StartFinale()
18-
tail call void @D_AdvanceDemo()
19-
%call.i.i449 = call i32 @R_FlatNumForName()
20-
%call9.i.i = call i32 @R_TextureNumForName()
21-
%call.i306 = tail call ptr @P_TempSaveGameFile()
22-
%call1.i307 = call ptr @P_SaveGameFile()
23-
call void (...) @I_Error()
15+
; CHECK-LABEL: P_RemoveMobj:
16+
define void @P_RemoveMobj() {
2417
ret void
2518
}
2619

27-
define void @G_DoReborn() {
28-
call void @P_RemoveMobj()
29-
call void @P_SpawnMobj()
30-
call void @P_SpawnPlayer()
31-
call void (...) @I_Error()
20+
; CHECK-LABEL: P_SpawnMobj:
21+
define void @P_SpawnMobj() {
3222
ret void
3323
}
3424

35-
define void @AM_Stop() {
25+
; CHECK-LABEL: G_PlayerReborn:
26+
define void @G_PlayerReborn() {
3627
ret void
3728
}
3829

39-
define void @D_AdvanceDemo() {
30+
; CHECK-LABEL: P_SetThingPosition:
31+
define void @P_SetThingPosition() {
4032
ret void
4133
}
4234

43-
define void @F_StartFinale() {
35+
; CHECK-LABEL: P_SetupPsprites:
36+
define void @P_SetupPsprites(ptr addrspace(1) %i) {
37+
%fptr = load ptr, ptr addrspace(1) %i, align 8
38+
tail call void %fptr()
4439
ret void
4540
}
4641

47-
define void @F_Ticker() {
42+
; CHECK-LABEL: HU_Start:
43+
define void @HU_Start() {
4844
ret void
4945
}
5046

51-
define void @G_PlayerReborn() {
47+
; CHECK-LABEL: P_SpawnPlayer:
48+
define void @P_SpawnPlayer() {
49+
call void @G_PlayerReborn()
50+
call void @P_SetThingPosition()
51+
call void @P_SetupPsprites(ptr addrspace(1) null)
52+
tail call void @HU_Start()
5253
ret void
5354
}
5455

55-
define i32 @G_CheckDemoStatus() {
56-
tail call void @I_Quit()
57-
tail call void @D_AdvanceDemo()
58-
call void (...) @I_Error()
59-
ret i32 0
60-
}
61-
62-
define void @HU_Start() {
56+
; CHECK-LABEL: I_Error:
57+
define void @I_Error(...) {
58+
%fptr = load ptr, ptr null, align 8
59+
call void %fptr()
6360
ret void
6461
}
6562

66-
define void @I_Quit() {
67-
%fptr = load ptr, ptr null, align 8
68-
tail call void %fptr()
63+
; CHECK-LABEL: G_DoReborn:
64+
define void @G_DoReborn() {
65+
call void @P_RemoveMobj()
66+
call void @P_SpawnMobj()
67+
call void @P_SpawnPlayer()
68+
call void (...) @I_Error()
6969
ret void
7070
}
7171

72-
define void @P_SetThingPosition() {
72+
; CHECK-LABEL: AM_Stop:
73+
define void @AM_Stop() {
7374
ret void
7475
}
7576

76-
define void @P_RemoveMobj() {
77+
; CHECK-LABEL: D_AdvanceDemo:
78+
define void @D_AdvanceDemo() {
7779
ret void
7880
}
7981

80-
define void @P_SpawnMobj() {
82+
; CHECK-LABEL: F_StartFinale:
83+
define void @F_StartFinale() {
8184
ret void
8285
}
8386

84-
define void @P_SpawnPlayer() {
85-
call void @G_PlayerReborn()
86-
call void @P_SetThingPosition()
87-
call void @P_SetupPsprites(ptr addrspace(1) null)
88-
tail call void @HU_Start()
87+
; CHECK-LABEL: F_Ticker:
88+
define void @F_Ticker() {
8989
ret void
9090
}
9191

92-
define void @P_SetupPsprites(ptr addrspace(1) %i) {
93-
%fptr = load ptr, ptr addrspace(1) %i, align 8
94-
tail call void %fptr()
95-
ret void
92+
; CHECK-LABEL: G_CheckDemoStatus:
93+
define i32 @G_CheckDemoStatus() {
94+
tail call void @I_Quit()
95+
tail call void @D_AdvanceDemo()
96+
call void (...) @I_Error()
97+
ret i32 0
9698
}
9799

100+
101+
; CHECK-LABEL: P_TempSaveGameFile:
98102
define ptr @P_TempSaveGameFile() {
99103
ret ptr null
100104
}
101105

106+
; CHECK-LABEL: P_SaveGameFile:
102107
define ptr @P_SaveGameFile() {
103108
ret ptr null
104109
}
105110

111+
; CHECK-LABEL: R_FlatNumForName:
112+
define i32 @R_FlatNumForName() {
113+
call void (...) @I_Error()
114+
unreachable
115+
}
116+
117+
; CHECK-LABEL: R_TextureNumForName:
106118
define i32 @R_TextureNumForName() {
107119
%ret = call i32 @R_FlatNumForName()
108120
ret i32 0
109121
}
110122

111-
define void @I_Error(...) {
112-
%fptr = load ptr, ptr null, align 8
113-
call void %fptr()
123+
; CHECK-LABEL: G_Ticker:
124+
define void @G_Ticker() {
125+
call void @G_DoReborn()
126+
tail call void @F_Ticker()
127+
tail call void @AM_Stop()
128+
tail call void @F_StartFinale()
129+
tail call void @D_AdvanceDemo()
130+
%call.i.i449 = call i32 @R_FlatNumForName()
131+
%call9.i.i = call i32 @R_TextureNumForName()
132+
%call.i306 = tail call ptr @P_TempSaveGameFile()
133+
%call1.i307 = call ptr @P_SaveGameFile()
134+
call void (...) @I_Error()
114135
ret void
115136
}
116137

117-
define i32 @R_FlatNumForName() {
118-
call void (...) @I_Error()
119-
unreachable
138+
; CHECK-LABEL: RunTic:
139+
define void @RunTic() {
140+
%call5.i1 = call i32 @G_CheckDemoStatus()
141+
tail call void @D_AdvanceDemo()
142+
call void @G_Ticker()
143+
ret void
120144
}

0 commit comments

Comments
 (0)