summaryrefslogtreecommitdiff
path: root/test/elf/X86_64/initfini-order.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/elf/X86_64/initfini-order.test')
-rw-r--r--test/elf/X86_64/initfini-order.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/elf/X86_64/initfini-order.test b/test/elf/X86_64/initfini-order.test
new file mode 100644
index 0000000000000..d3981eb0914e9
--- /dev/null
+++ b/test/elf/X86_64/initfini-order.test
@@ -0,0 +1,10 @@
+# This tests the functionality that lld is able to emit
+# init_array/fini_array sections in the right order.
+
+RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/initfini.o \
+RUN: --noinhibit-exec -o %t
+RUN: llvm-objdump -t -section-headers %t | FileCheck %s
+
+CHECK: {{[0-9]+}} .eh_frame {{[0-9a-z]+}} {{[0-9a-z]+}} DATA
+CHECK: {{[0-9]+}} .init_array {{[0-9a-z]+}} {{[0-9a-z]+}} DATA
+CHECK: {{[0-9]+}} .fini_array {{[0-9a-z]+}} {{[0-9a-z]+}} DATA