summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Feature/elf-linker-options.ll16
-rw-r--r--llvm/test/MC/ELF/section.s14
-rw-r--r--llvm/test/tools/llvm-readobj/elf-linker-options.ll11
3 files changed, 41 insertions, 0 deletions
diff --git a/llvm/test/Feature/elf-linker-options.ll b/llvm/test/Feature/elf-linker-options.ll
new file mode 100644
index 00000000000..7e002c27b9e
--- /dev/null
+++ b/llvm/test/Feature/elf-linker-options.ll
@@ -0,0 +1,16 @@
+; RUN: llc -mtriple x86_64-elf -filetype asm -o - %s | FileCheck %s
+
+!llvm.linker.options = !{!0, !1}
+
+!0 = !{!"option 0", !"value 0"}
+!1 = !{!"option 1", !"value 1"}
+
+; CHECK: .section ".linker-options","e",@llvm_linker_options
+; CHECK-NEXT: .ascii "option 0"
+; CHECK-NEXT: .byte 0
+; CHECK-NEXT: .ascii "value 0"
+; CHECK-NEXT: .byte 0
+; CHECK-NEXT: .ascii "option 1"
+; CHECK-NEXT: .byte 0
+; CHECK-NEXT: .ascii "value 1"
+; CHECK-NEXT: .byte 0
diff --git a/llvm/test/MC/ELF/section.s b/llvm/test/MC/ELF/section.s
index c3f7d426ba5..57755223db1 100644
--- a/llvm/test/MC/ELF/section.s
+++ b/llvm/test/MC/ELF/section.s
@@ -279,3 +279,17 @@ bar:
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_EXCLUDE
// CHECK-NEXT: ]
+
+// Test SHT_LLVM_LINKER_OPTIONS
+
+.section ".linker-options","e",@llvm_linker_options
+// ASM: .section ".linker-options","e",@llvm_linker_options
+
+// CHECK: Section {
+// CHECK: Name: .linker-options
+// CHECK-NEXT: Type: SHT_LLVM_LINKER_OPTIONS
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: SHF_EXCLUDE
+// CHECK-NEXT: ]
+// CHECK: }
+
diff --git a/llvm/test/tools/llvm-readobj/elf-linker-options.ll b/llvm/test/tools/llvm-readobj/elf-linker-options.ll
new file mode 100644
index 00000000000..6f96613c777
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/elf-linker-options.ll
@@ -0,0 +1,11 @@
+; RUN: llc -mtriple x86_64-elf -filetype obj -o - %s | llvm-readobj -elf-linker-options - | FileCheck %s
+
+!llvm.linker.options = !{!0, !1}
+
+!0 = !{!"option 0", !"value 0"}
+!1 = !{!"option 1", !"value 1"}
+
+; CHECK: LinkerOptions [
+; CHECK: option 0: value 0
+; CHECK: option 1: value 1
+; CHECK: ]
OpenPOWER on IntegriCloud