summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/RISCV/init-array.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/RISCV/init-array.ll')
-rw-r--r--llvm/test/CodeGen/RISCV/init-array.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/RISCV/init-array.ll b/llvm/test/CodeGen/RISCV/init-array.ll
new file mode 100644
index 00000000000..1927eeb6d11
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/init-array.ll
@@ -0,0 +1,30 @@
+; RUN: llc -mtriple=riscv32-unknown-linux-gnu -verify-machineinstrs -o - %s \
+; RUN: | FileCheck --check-prefix=INITARRAY %s
+; RUN: llc -mtriple=riscv32-unknown-elf -verify-machineinstrs -o - %s \
+; RUN: | FileCheck --check-prefix=INITARRAY %s
+; RUN: llc -mtriple=riscv64-unknown-linux-gnu -verify-machineinstrs -o - %s \
+; RUN: | FileCheck --check-prefix=INITARRAY %s
+; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs -o - %s \
+; RUN: | FileCheck --check-prefix=INITARRAY %s
+
+; RUN: llc -mtriple=riscv32-unknown-linux-gnu -verify-machineinstrs -use-ctors -o - %s \
+; RUN: | FileCheck --check-prefix=CTOR %s
+; RUN: llc -mtriple=riscv32-unknown-elf -verify-machineinstrs -use-ctors -o - %s \
+; RUN: | FileCheck --check-prefix=CTOR %s
+; RUN: llc -mtriple=riscv64-unknown-linux-gnu -verify-machineinstrs -use-ctors -o - %s \
+; RUN: | FileCheck --check-prefix=CTOR %s
+; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs -use-ctors -o - %s \
+; RUN: | FileCheck --check-prefix=CTOR %s
+
+define internal void @_GLOBAL__I_a() section ".text.startup" {
+ ret void
+}
+
+@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
+
+;INITARRAY: section .init_array
+;INITARRAY-NOT: .section .ctors
+
+;CTOR: .section .ctors
+;CTOR-NOT: section .init_array
+
OpenPOWER on IntegriCloud