1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3# RUN: echo '.section .foo,"ae"; .weak foo; foo:' | \
4# RUN:   llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o
5# RUN: not ld.lld %t.o %t1.o -o /dev/null 2>&1 | FileCheck %s
6
7# Because foo defined in %t1.o is weak, it does not override global undefined
8# in %t.o
9# CHECK-NOT: discarded section
10# CHECK: undefined symbol: foo
11
12.globl _start
13_start:
14  jmp foo
15