Index: test/ELF/arm-thumb-undefined-weak-narrow.s =================================================================== --- /dev/null +++ test/ELF/arm-thumb-undefined-weak-narrow.s @@ -0,0 +1,21 @@ +// REQUIRES: arm +// RUN: ld.lld %S/Inputs/arm-thumb-narrow-undefined-weak.o -o %t +// RUN: llvm-objdump -triple=thumbv7a-linux-gnueabi -d %t | FileCheck %s + +// CHECK: Disassembly of section .text: +// CHECK-NEXT: __start: +// CHECK-NEXT: 11000: ff e7 b #-2 + +// llvm-mc relaxes the b.n to a b.w as undefined_weak is external to the +// section so we must use a binary object produced by GNU as. It can be +// reproduced with arm-linux-gnueabihf-gcc -c filename.s -o filename.o where +// filename.s contains the code below. The object in Inputs was produced +// by arm-linux-gnueabihf-gcc (Linaro GCC 5.3-2016.02) 5.3.1 20160113 +// +// .thumb +// .syntax unified +// +// .weak undefined_weak +// .globl _start +// .type _start, %function +// __start: b.n undefine_weak