This patch fixes a Mips specific bug where
[oota-llvm.git] / test / MC / Mips / elf-gprel-32-64.ll
1 ; RUN: llc -filetype=obj -march=mips64el -mcpu=mips64 %s -o - \
2 ; RUN: | elf-dump --dump-section-data \
3 ; RUN: | FileCheck %s
4
5 define i32 @test(i32 %c) nounwind {
6 entry:
7   switch i32 %c, label %sw.default [
8     i32 0, label %sw.bb
9     i32 1, label %sw.bb2
10     i32 2, label %sw.bb5
11     i32 3, label %sw.bb8
12   ]
13
14 sw.bb:
15   br label %return
16 sw.bb2:
17   br label %return
18 sw.bb5:
19   br label %return
20 sw.bb8:
21   br label %return
22 sw.default:
23   br label %return
24
25 return:
26   %retval.0 = phi i32 [ -1, %sw.default ], [ 7, %sw.bb8 ], [ 2, %sw.bb5 ], [ 3, %sw.bb2 ], [ 1, %sw.bb ]
27   ret i32 %retval.0
28 }
29
30 ; Check that the appropriate relocations were created.
31
32 ; R_MIPS_GPREL32/R_MIPS_64/R_MIPS_NONE
33 ; CHECK: (('sh_name', 0x{{[a-z0-9]+}}) # '.rela.rodata'
34 ; CHECK:      ('r_type3', 0x00)
35 ; CHECK-NEXT: ('r_type2', 0x12)
36 ; CHECK-NEXT: ('r_type', 0x0c)
37