aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/RISCV/init-array.ll
blob: b514e6fe8f4e0518780a5a5c1203b59814aebda1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
; 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, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__I_a, ptr null }]

;INITARRAY: section .init_array
;INITARRAY-NOT: .section    .ctors

;CTOR: .section .ctors
;CTOR-NOT:  section .init_array