xref: /aosp_15_r20/external/llvm/test/MC/COFF/switch-relocations.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; The purpose of this test is to see if the COFF object writer can properly
2*9880d681SAndroid Build Coastguard Worker; relax the fixups that are created for jump tables on x86-64. See PR7960.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; This test case was reduced from Lua/lapi.c.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; This test has yet to be converted to assembly becase llvm-mc cannot read
7*9880d681SAndroid Build Coastguard Worker; x86-64 COFF code yet.
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o %t
10*9880d681SAndroid Build Coastguard Worker; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o %t
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Workerdefine void @lua_gc(i32 %what) nounwind {
13*9880d681SAndroid Build Coastguard Workerentry:
14*9880d681SAndroid Build Coastguard Worker  switch i32 %what, label %sw.epilog [
15*9880d681SAndroid Build Coastguard Worker    i32 0, label %sw.bb
16*9880d681SAndroid Build Coastguard Worker    i32 1, label %sw.bb
17*9880d681SAndroid Build Coastguard Worker    i32 2, label %sw.bb
18*9880d681SAndroid Build Coastguard Worker    i32 3, label %sw.bb14
19*9880d681SAndroid Build Coastguard Worker    i32 4, label %sw.bb18
20*9880d681SAndroid Build Coastguard Worker    i32 6, label %sw.bb57
21*9880d681SAndroid Build Coastguard Worker  ]
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workersw.bb:                                            ; preds = %entry, %entry, %entry
24*9880d681SAndroid Build Coastguard Worker  ret void
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Workersw.bb14:                                          ; preds = %entry
27*9880d681SAndroid Build Coastguard Worker  ret void
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workersw.bb18:                                          ; preds = %entry
30*9880d681SAndroid Build Coastguard Worker  ret void
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workersw.bb57:                                          ; preds = %entry
33*9880d681SAndroid Build Coastguard Worker  ret void
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Workersw.epilog:                                        ; preds = %entry
36*9880d681SAndroid Build Coastguard Worker  ret void
37*9880d681SAndroid Build Coastguard Worker}
38