George Rimar | 86ce267 | 2016-08-25 09:05:47 +0000 | [diff] [blame] | 1 | # REQUIRES: x86 |
| 2 | # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t |
| 3 | |
| 4 | # RUN: ld.lld -o %t.out %t --oformat binary |
Rui Ueyama | b397ab5 | 2016-09-02 20:20:04 +0000 | [diff] [blame] | 5 | # RUN: od -t x1 -v %t.out | FileCheck %s |
| 6 | # CHECK: 000000 90 11 22 00 00 00 00 00 |
George Rimar | 86ce267 | 2016-08-25 09:05:47 +0000 | [diff] [blame] | 7 | # CHECK-NOT: 00000010 |
| 8 | |
| 9 | ## Check case when linkerscript is used. |
| 10 | # RUN: echo "SECTIONS { . = 0x1000; }" > %t.script |
| 11 | # RUN: ld.lld -o %t2.out --script %t.script %t --oformat binary |
Rui Ueyama | b397ab5 | 2016-09-02 20:20:04 +0000 | [diff] [blame] | 12 | # RUN: od -t x1 -v %t2.out | FileCheck %s |
George Rimar | 86ce267 | 2016-08-25 09:05:47 +0000 | [diff] [blame] | 13 | |
| 14 | # RUN: not ld.lld -o %t3.out %t --oformat foo 2>&1 \ |
| 15 | # RUN: | FileCheck %s --check-prefix ERR |
| 16 | # ERR: unknown --oformat value: foo |
| 17 | |
| 18 | .text |
| 19 | .align 4 |
| 20 | .globl _start |
| 21 | _start: |
| 22 | nop |
| 23 | |
| 24 | .section .mysec.1,"ax" |
| 25 | .byte 0x11 |
| 26 | |
| 27 | .section .mysec.2,"ax" |
| 28 | .byte 0x22 |