[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / MC / Sparc / sparc-relocations.s
blob44e3cedc37d38c86bc1ed4b8e5b42aac0790fc31
1 ! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
2 ! RUN: llvm-mc %s -arch=sparcv9 -filetype=obj | llvm-readobj -r | FileCheck %s --check-prefix=CHECK-OBJ
4 ! CHECK-OBJ: Format: ELF64-sparc
5 ! CHECK-OBJ: Relocations [
6 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_WDISP30 foo
7 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_LO10 sym
8 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_HI22 sym
9 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_H44 sym
10 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_M44 sym
11 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_L44 sym
12 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_HH22 sym
13 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_HM10 sym
14 ! CHECK-OBJ: 0x{{[0-9,A-F]+}} R_SPARC_13 sym
15 ! CHECK-ELF: ]
17 ! CHECK: call foo ! encoding: [0b01AAAAAA,A,A,A]
18 ! CHECK: ! fixup A - offset: 0, value: foo, kind: fixup_sparc_call30
19 call foo
21 ! CHECK: or %g1, %lo(sym), %g3 ! encoding: [0x86,0x10,0b011000AA,A]
22 ! CHECK-NEXT: ! fixup A - offset: 0, value: %lo(sym), kind: fixup_sparc_lo10
23 or %g1, %lo(sym), %g3
25 ! CHECK: sethi %hi(sym), %l0 ! encoding: [0x21,0b00AAAAAA,A,A]
26 ! CHECK-NEXT: ! fixup A - offset: 0, value: %hi(sym), kind: fixup_sparc_hi22
27 sethi %hi(sym), %l0
29 ! CHECK: sethi %h44(sym), %l0 ! encoding: [0x21,0b00AAAAAA,A,A]
30 ! CHECK-NEXT: ! fixup A - offset: 0, value: %h44(sym), kind: fixup_sparc_h44
31 sethi %h44(sym), %l0
33 ! CHECK: or %g1, %m44(sym), %g3 ! encoding: [0x86,0x10,0b011000AA,A]
34 ! CHECK-NEXT: ! fixup A - offset: 0, value: %m44(sym), kind: fixup_sparc_m44
35 or %g1, %m44(sym), %g3
37 ! CHECK: or %g1, %l44(sym), %g3 ! encoding: [0x86,0x10,0b0110AAAA,A]
38 ! CHECK-NEXT: ! fixup A - offset: 0, value: %l44(sym), kind: fixup_sparc_l44
39 or %g1, %l44(sym), %g3
41 ! CHECK: sethi %hh(sym), %l0 ! encoding: [0x21,0b00AAAAAA,A,A]
42 ! CHECK-NEXT: ! fixup A - offset: 0, value: %hh(sym), kind: fixup_sparc_hh
43 sethi %hh(sym), %l0
45 ! CHECK: or %g1, %hm(sym), %g3 ! encoding: [0x86,0x10,0b011000AA,A]
46 ! CHECK-NEXT: ! fixup A - offset: 0, value: %hm(sym), kind: fixup_sparc_hm
47 or %g1, %hm(sym), %g3
49 ! CHECK: or %g1, sym, %g3 ! encoding: [0x86,0x10,0b011AAAAA,A]
50 ! CHECK-NEXT: ! fixup A - offset: 0, value: sym, kind: fixup_sparc_13
51 or %g1, sym, %g3
53 ! This test needs to placed last in the file
54 ! CHECK: .half a-.Ltmp0
55 .half a - .
56 .byte a - .