Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / undef-suggest-extern-c.s
blob8c53c8e602cad787fc4b0a6188ba05349c248b64
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o
4 ## The reference is mangled while the definition is not, suggest a missing
5 ## extern "C".
6 # RUN: echo 'call __Z3fooi' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
7 # RUN: not %lld %t.o %t1.o -demangle -o /dev/null 2>&1 | FileCheck %s
9 # CHECK: error: undefined symbol: foo(int)
10 # CHECK-NEXT: >>> referenced by {{.*}}
11 # CHECK-NEXT: >>> did you mean: extern "C" foo
13 ## Don't suggest for nested names like F::foo() and foo::foo().
14 # RUN: echo 'call __ZN1F3fooEv; call __ZN3fooC1Ev' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t2.o
15 # RUN: not ld.lld %t.o %t2.o -o /dev/null 2>&1 | FileCheck /dev/null --implicit-check-not='did you mean'
17 .globl _start, _foo
18 _start:
19 _foo: