summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/dsymutil/ARM/fat-arch-not-found.test13
-rw-r--r--llvm/test/tools/dsymutil/ARM/lit.local.cfg2
-rw-r--r--llvm/test/tools/dsymutil/Inputs/fat-test.c17
-rw-r--r--llvm/test/tools/dsymutil/Inputs/fat-test.obin0 -> 5000 bytes
-rw-r--r--llvm/test/tools/dsymutil/Inputs/libfat-test.abin0 -> 5136 bytes
-rw-r--r--llvm/test/tools/dsymutil/X86/fat-archive-input-i386.test16
-rw-r--r--llvm/test/tools/dsymutil/X86/fat-object-input-x86_64.test16
-rw-r--r--llvm/test/tools/dsymutil/X86/fat-object-input-x86_64h.test16
8 files changed, 80 insertions, 0 deletions
diff --git a/llvm/test/tools/dsymutil/ARM/fat-arch-not-found.test b/llvm/test/tools/dsymutil/ARM/fat-arch-not-found.test
new file mode 100644
index 00000000000..89b518cd16f
--- /dev/null
+++ b/llvm/test/tools/dsymutil/ARM/fat-arch-not-found.test
@@ -0,0 +1,13 @@
+# REQUIRES: object-emission
+# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - 2>&1 | FileCheck %s
+
+---
+triple: 'armv7-apple-darwin'
+objects:
+ - filename: libfat-test.a(fat-test.o)
+ symbols:
+ - { sym: _armv7_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
+...
+
+# CHECK: libfat-test.a(fat-test.o): No object file for requested architecture
+
diff --git a/llvm/test/tools/dsymutil/ARM/lit.local.cfg b/llvm/test/tools/dsymutil/ARM/lit.local.cfg
new file mode 100644
index 00000000000..c8625f4d9d2
--- /dev/null
+++ b/llvm/test/tools/dsymutil/ARM/lit.local.cfg
@@ -0,0 +1,2 @@
+if not 'X86' in config.root.targets:
+ config.unsupported = True
diff --git a/llvm/test/tools/dsymutil/Inputs/fat-test.c b/llvm/test/tools/dsymutil/Inputs/fat-test.c
new file mode 100644
index 00000000000..42c1fce1ec3
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/fat-test.c
@@ -0,0 +1,17 @@
+/* Compile with:
+ clang -c -g -arch x86_64h -arch x86_64 -arch i386 fat-test.c
+ libtool -static -o libfat-test.a fat-test.o
+
+ To reduce the size of the fat .o:
+ lipo -thin i386 -o fat-test.i386.o fat-test.o
+ lipo -thin x86_64 -o fat-test.x86_64.o fat-test.o
+ lipo -thin x86_64h -o fat-test.x86_64h.o fat-test.o
+ lipo -create -arch x86_64h fat-test.x86_64h.o -arch x86_64 fat-test.x86_64.o -arch i386 fat-test.i386.o -o fat-test.o -segalign i386 8 -segalign x86_64 8 -segalign x86_64h 8
+ */
+#ifdef __x86_64h__
+int x86_64h_var;
+#elif defined(__x86_64__)
+int x86_64_var;
+#else
+int i386_var;
+#endif
diff --git a/llvm/test/tools/dsymutil/Inputs/fat-test.o b/llvm/test/tools/dsymutil/Inputs/fat-test.o
new file mode 100644
index 00000000000..8159cc74977
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/fat-test.o
Binary files differ
diff --git a/llvm/test/tools/dsymutil/Inputs/libfat-test.a b/llvm/test/tools/dsymutil/Inputs/libfat-test.a
new file mode 100644
index 00000000000..6b34b0fd6f9
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/libfat-test.a
Binary files differ
diff --git a/llvm/test/tools/dsymutil/X86/fat-archive-input-i386.test b/llvm/test/tools/dsymutil/X86/fat-archive-input-i386.test
new file mode 100644
index 00000000000..7f17ff48372
--- /dev/null
+++ b/llvm/test/tools/dsymutil/X86/fat-archive-input-i386.test
@@ -0,0 +1,16 @@
+# REQUIRES: object-emission
+# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+
+---
+triple: 'i386-apple-darwin'
+objects:
+ - filename: libfat-test.a(fat-test.o)
+ symbols:
+ - { sym: _i386_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
+...
+
+# CHECK: .debug_info contents:
+# CHECK: DW_TAG_variable
+# CHECK-NOT: {{DW_TAG|NULL}}
+# CHECK: DW_AT_name{{.*}}"i386_var"
+
diff --git a/llvm/test/tools/dsymutil/X86/fat-object-input-x86_64.test b/llvm/test/tools/dsymutil/X86/fat-object-input-x86_64.test
new file mode 100644
index 00000000000..489afece120
--- /dev/null
+++ b/llvm/test/tools/dsymutil/X86/fat-object-input-x86_64.test
@@ -0,0 +1,16 @@
+# REQUIRES: object-emission
+# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+
+---
+triple: 'x86_64-apple-darwin'
+objects:
+ - filename: fat-test.o
+ symbols:
+ - { sym: _x86_64_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
+...
+
+# CHECK: .debug_info contents:
+# CHECK: DW_TAG_variable
+# CHECK-NOT: {{DW_TAG|NULL}}
+# CHECK: DW_AT_name{{.*}}"x86_64_var"
+
diff --git a/llvm/test/tools/dsymutil/X86/fat-object-input-x86_64h.test b/llvm/test/tools/dsymutil/X86/fat-object-input-x86_64h.test
new file mode 100644
index 00000000000..f611f5516f5
--- /dev/null
+++ b/llvm/test/tools/dsymutil/X86/fat-object-input-x86_64h.test
@@ -0,0 +1,16 @@
+# REQUIRES: object-emission
+# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+
+---
+triple: 'x86_64h-apple-darwin'
+objects:
+ - filename: fat-test.o
+ symbols:
+ - { sym: _x86_64h_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
+...
+
+# CHECK: .debug_info contents:
+# CHECK: DW_TAG_variable
+# CHECK-NOT: {{DW_TAG|NULL}}
+# CHECK: DW_AT_name{{.*}}"x86_64h_var"
+
OpenPOWER on IntegriCloud