X86: produce more friendly errors during MachO relocation handling
[oota-llvm.git] / test / MC / Mips / elf-N64.s
1 // RUN: llvm-mc -filetype=obj -triple=mips64el-pc-linux -mcpu=mips64  %s -o - | llvm-readobj -r | FileCheck %s
2 // RUN: llvm-mc -filetype=obj -triple=mips64-pc-linux -mcpu=mips64  %s -o - | llvm-readobj -r | FileCheck %s
3
4 // Check for N64 relocation production.
5 // Check that the appropriate relocations were created.
6
7 // CHECK: Relocations [
8 // CHECK:   0x{{[0-9,A-F]+}} R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16
9 // CHECK:   0x{{[0-9,A-F]+}} R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16
10 // CHECK:   0x{{[0-9,A-F]+}} R_MIPS_GOT_PAGE/R_MIPS_NONE/R_MIPS_NONE
11 // CHECK:   0x{{[0-9,A-F]+}} R_MIPS_GOT_OFST/R_MIPS_NONE/R_MIPS_NONE
12 // CHECK: ]
13
14
15         .text
16         .abicalls
17         .section        .mdebug.abi64,"",@progbits
18         .file   "/home/espindola/llvm/llvm/test/MC/Mips/elf-N64.ll"
19         .text
20         .globl  main
21         .align  3
22         .type   main,@function
23         .set    nomips16
24         .ent    main
25 main:                                   # @main
26         .frame  $sp,16,$ra
27         .mask   0x00000000,0
28         .fmask  0x90000000,-4
29         .set    noreorder
30         .set    nomacro
31         .set    noat
32 # BB#0:                                 # %entry
33         daddiu  $sp, $sp, -16
34         sd      $ra, 8($sp)             # 8-byte Folded Spill
35         sd      $gp, 0($sp)             # 8-byte Folded Spill
36         lui     $1, %hi(%neg(%gp_rel(main)))
37         daddu   $1, $1, $25
38         daddiu  $gp, $1, %lo(%neg(%gp_rel(main)))
39         ld      $1, %got_page($str)($gp)
40         daddiu  $4, $1, %got_ofst($str)
41         ld      $25, %call16(puts)($gp)
42         jalr    $25
43         nop
44         addiu   $2, $zero, 0
45         ld      $gp, 0($sp)             # 8-byte Folded Reload
46         ld      $ra, 8($sp)             # 8-byte Folded Reload
47         daddiu  $sp, $sp, 16
48         jr      $ra
49         nop
50         .set    at
51         .set    macro
52         .set    reorder
53         .end    main
54 $tmp0:
55         .size   main, ($tmp0)-main
56
57         .type   $str,@object            # @str
58         .section        .rodata.str1.4,"aMS",@progbits,1
59         .align  2
60 $str:
61         .asciz  "hello world"
62         .size   $str, 12
63
64
65         .text