summaryrefslogtreecommitdiff
path: root/test/Object
diff options
context:
space:
mode:
Diffstat (limited to 'test/Object')
-rw-r--r--test/Object/Inputs/invalid-bad-rel-type.elfbin0 -> 845 bytes
-rw-r--r--test/Object/dllimport.ll17
-rw-r--r--test/Object/invalid.test2
-rw-r--r--test/Object/nm-archive.test9
4 files changed, 28 insertions, 0 deletions
diff --git a/test/Object/Inputs/invalid-bad-rel-type.elf b/test/Object/Inputs/invalid-bad-rel-type.elf
new file mode 100644
index 000000000000..2caebcdd1e59
--- /dev/null
+++ b/test/Object/Inputs/invalid-bad-rel-type.elf
Binary files differ
diff --git a/test/Object/dllimport.ll b/test/Object/dllimport.ll
new file mode 100644
index 000000000000..afdb4562cc9f
--- /dev/null
+++ b/test/Object/dllimport.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as %s -o - | llvm-nm - | FileCheck %s
+
+target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc"
+
+; CHECK: U __imp_f
+; CHECK: U __imp_v
+; CHECK: T g
+
+declare dllimport void @f()
+@v = external dllimport global i32
+
+define void @g() {
+ call void @f()
+ store i32 42, i32* @v
+ ret void
+}
diff --git a/test/Object/invalid.test b/test/Object/invalid.test
new file mode 100644
index 000000000000..73bf62a1ed4e
--- /dev/null
+++ b/test/Object/invalid.test
@@ -0,0 +1,2 @@
+RUN: not llvm-dwarfdump %p/Inputs/invalid-bad-rel-type.elf 2>&1 | FileCheck %s
+CHECK: Invalid data was encountered while parsing the file
diff --git a/test/Object/nm-archive.test b/test/Object/nm-archive.test
index a9ae9cbbfbd6..4cd58d33cf28 100644
--- a/test/Object/nm-archive.test
+++ b/test/Object/nm-archive.test
@@ -24,6 +24,15 @@ RUN: rm -f %t2
RUN: llvm-ar rcs %t2 %t1
RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
+RUN: rm -f %t2
+RUN: llvm-lib /out:%t2 %t1
+RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
+
+RUN: rm -f %t2
+RUN: echo /out:%t2 %t1 > %t.rsp
+RUN: llvm-lib @%t.rsp
+RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
+
BITCODE: U SomeOtherFunction
BITCODE-NEXT: T main
BITCODE-NEXT: U puts