Fix COFF x86-64 relocations. PR7960.
[oota-llvm.git] / test / MC / COFF / switch-relocations.ll
1 ; The purpose of this test is to see if the COFF object writer can properly
2 ; relax the fixups that are created for jump tables on x86-64. See PR7960.
3
4 ; This test case was reduced from Lua/lapi.c.
5
6 ; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o %t
7 ; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o %t
8
9 define void @lua_gc(i32 %what) nounwind {
10 entry:
11   switch i32 %what, label %sw.epilog [
12     i32 0, label %sw.bb
13     i32 1, label %sw.bb
14     i32 2, label %sw.bb
15     i32 3, label %sw.bb14
16     i32 4, label %sw.bb18
17     i32 6, label %sw.bb57
18   ]
19
20 sw.bb:                                            ; preds = %entry, %entry, %entry
21   ret void
22
23 sw.bb14:                                          ; preds = %entry
24   ret void
25
26 sw.bb18:                                          ; preds = %entry
27   ret void
28
29 sw.bb57:                                          ; preds = %entry
30   ret void
31
32 sw.epilog:                                        ; preds = %entry
33   ret void
34 }