summaryrefslogtreecommitdiff
path: root/test/elf/X86_64/undef.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/elf/X86_64/undef.test')
-rw-r--r--test/elf/X86_64/undef.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/elf/X86_64/undef.test b/test/elf/X86_64/undef.test
new file mode 100644
index 0000000000000..8f0039a146938
--- /dev/null
+++ b/test/elf/X86_64/undef.test
@@ -0,0 +1,18 @@
+# This tests the functionality that an undefined symbol thats defined in the
+# commmand line pulls in the required object file from the archive library
+# which is usually the usecase for it
+RUN: lld -flavor gnu -target x86_64 -u fn %p/Inputs/libfn.a -o %t --noinhibit-exec
+RUN: llvm-readobj -symbols %t | FileCheck -check-prefix=SYMFROMARCHIVE %s
+RUN: lld -flavor gnu -target x86_64 %p/Inputs/libfn.a -o %t --noinhibit-exec
+RUN: llvm-readobj -symbols %t | FileCheck %s
+
+SYMFROMARCHIVE: Symbol {
+SYMFROMARCHIVE: Name: fn ({{[0-9]+}}
+SYMFROMARCHIVE: Size: 11
+SYMFROMARCHIVE: Binding: Global (0x1)
+SYMFROMARCHIVE: Type: Function (0x2)
+SYMFROMARCHIVE: Other: 0
+SYMFROMARCHIVE: Section: .text
+SYMFROMARCHIVE: }
+
+CHECK-NOT: Name: fn