xref: /llvm-project/llvm/test/CodeGen/RISCV/init-array.ll (revision 9e1ad3cff6a855fdfdc1d91323e2021726da04ea)
1; RUN: llc -mtriple=riscv32-unknown-linux-gnu -verify-machineinstrs -o - %s \
2; RUN: | FileCheck --check-prefix=INITARRAY %s
3; RUN: llc -mtriple=riscv32-unknown-elf -verify-machineinstrs -o - %s \
4; RUN: | FileCheck --check-prefix=INITARRAY %s
5; RUN: llc -mtriple=riscv64-unknown-linux-gnu -verify-machineinstrs -o - %s \
6; RUN: | FileCheck --check-prefix=INITARRAY %s
7; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs -o - %s \
8; RUN: | FileCheck --check-prefix=INITARRAY %s
9
10; RUN: llc -mtriple=riscv32-unknown-linux-gnu -verify-machineinstrs -use-ctors -o - %s \
11; RUN: | FileCheck --check-prefix=CTOR %s
12; RUN: llc -mtriple=riscv32-unknown-elf -verify-machineinstrs -use-ctors -o - %s \
13; RUN: | FileCheck --check-prefix=CTOR %s
14; RUN: llc -mtriple=riscv64-unknown-linux-gnu -verify-machineinstrs -use-ctors -o - %s \
15; RUN: | FileCheck --check-prefix=CTOR %s
16; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs -use-ctors -o - %s \
17; RUN: | FileCheck --check-prefix=CTOR %s
18
19define internal void @_GLOBAL__I_a() section ".text.startup" {
20  ret void
21}
22
23@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__I_a, ptr null }]
24
25;INITARRAY: section .init_array
26;INITARRAY-NOT: .section    .ctors
27
28;CTOR: .section .ctors
29;CTOR-NOT:  section .init_array
30