Parse .gpdword and convert another llc -filetype=obj test.
[oota-llvm.git] / test / MC / Mips / elf-gprel-32-64.s
1 // RUN: llvm-mc -filetype=obj -triple=mips64el-pc-linux -mcpu=mips64 %s -o - \
2 // RUN: | llvm-readobj -r \
3 // RUN: | FileCheck %s
4
5 // Check that the appropriate relocations were created.
6
7 // R_MIPS_GPREL32/R_MIPS_64/R_MIPS_NONE
8 // CHECK:      Relocations [
9 // CHECK:        Section ({{[a-z0-9]+}}) .rela.rodata {
10 // CHECK-NEXT:     0x{{[0-9,A-F]+}} R_MIPS_GPREL32/R_MIPS_64/R_MIPS_NONE
11 // CHECK-NEXT:     0x{{[0-9,A-F]+}} R_MIPS_GPREL32/R_MIPS_64/R_MIPS_NONE
12 // CHECK-NEXT:     0x{{[0-9,A-F]+}} R_MIPS_GPREL32/R_MIPS_64/R_MIPS_NONE
13 // CHECK-NEXT:     0x{{[0-9,A-F]+}} R_MIPS_GPREL32/R_MIPS_64/R_MIPS_NONE
14 // CHECK-NEXT:   }
15 // CHECK-NEXT: ]
16
17         .text
18         .abicalls
19         .section        .mdebug.abi64,"",@progbits
20         .file   "/home/espindola/llvm/llvm/test/MC/Mips/elf-gprel-32-64.ll"
21         .text
22         .globl  test
23         .align  3
24         .type   test,@function
25         .set    nomips16
26         .ent    test
27 test:                                   # @test
28         .frame  $sp,0,$ra
29         .mask   0x00000000,0
30         .fmask  0x00000000,0
31         .set    noreorder
32         .set    nomacro
33         .set    noat
34 # BB#0:                                 # %entry
35         lui     $1, %hi(%neg(%gp_rel(test)))
36         daddu   $2, $1, $25
37         sltiu   $1, $4, 4
38         dsll    $3, $4, 32
39         bnez    $1, $BB0_2
40         nop
41 $BB0_1:                                 # %sw.default
42         b       $BB0_3
43         addiu   $2, $zero, -1
44 $BB0_2:                                 # %entry
45         daddiu  $1, $2, %lo(%neg(%gp_rel(test)))
46         dsrl    $3, $3, 32
47         daddiu  $4, $zero, 8
48         dmult   $3, $4
49         mflo    $3
50         ld      $4, %got_page($JTI0_0)($1)
51         daddu   $3, $3, $4
52         ld      $3, %got_ofst($JTI0_0)($3)
53         daddu   $1, $3, $1
54         jr      $1
55         addiu   $2, $zero, 1
56 $BB0_3:                                 # %return
57         jr      $ra
58         nop
59 $BB0_4:                                 # %sw.bb2
60         jr      $ra
61         addiu   $2, $zero, 3
62 $BB0_5:                                 # %sw.bb5
63         jr      $ra
64         addiu   $2, $zero, 2
65 $BB0_6:                                 # %sw.bb8
66         jr      $ra
67         addiu   $2, $zero, 7
68         .set    at
69         .set    macro
70         .set    reorder
71         .end    test
72 $tmp0:
73         .size   test, ($tmp0)-test
74         .section        .rodata,"a",@progbits
75         .align  3
76 $JTI0_0:
77         .gpdword        ($BB0_3)
78         .gpdword        ($BB0_4)
79         .gpdword        ($BB0_5)
80         .gpdword        ($BB0_6)
81
82
83         .text