• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; REQUIRES: msp430
2; RUN: llvm-mc -filetype=obj -triple=msp430-elf -o %t1.o %s
3; RUN: echo -e '.global _start\n _start: nop' | llvm-mc -filetype=obj -triple=msp430-elf -o %t2.o -
4; RUN: ld.lld -o %t.exe --Tdata=0x2000 --Ttext=0x8000 --defsym=_byte=0x21 -z separate-code %t2.o %t1.o
5; RUN: llvm-objdump -s -d %t.exe | FileCheck %s
6
7;; Check handling of basic msp430 relocation types.
8
9  .data
10;; R_MSP430_8
11  .byte _byte
12;; R_MSP430_16
13  .word _start
14;; R_MSP430_32
15  .long _start
16
17; CHECK:      Contents of section .data:
18; CHECK-NEXT: 2000 21008000 800000
19
20  .text
21  .global foo
22foo:
23;; R_MSP430_10_PCREL
24  jmp _start
25
26; CHECK:      Disassembly of section .text:
27; CHECK-EMPTY:
28; CHECK-NEXT: <_start>:
29; CHECK-NEXT: 8000: {{.*}} nop
30; CHECK:      <foo>:
31; CHECK-NEXT: 8004: {{.*}} jmp $-4
32
33;; R_MSP430_16_BYTE
34  call #_start
35
36; CHECK:      call #32768
37
38;; R_MSP430_16_PCREL_BYTE
39  mov #-1, _start
40
41; CHECK:      800a: {{.*}} mov #-1, -12
42
43; RUN: od -x %t.exe | FileCheck -check-prefix=TRAP %s
44; TRAP: 4343 4343 4343 4343 4343 4343 4343 4343
45