1 ; RUN: llc -mtriple x86_64-pc-linux -use-ctors < %s | FileCheck --check-prefix=CTOR %s
2 ; RUN: llc -mtriple x86_64-unknown-freebsd -use-ctors < %s | FileCheck --check-prefix=CTOR %s
3 ; RUN: llc -mtriple x86_64-pc-solaris2.11 -use-ctors < %s | FileCheck --check-prefix=CTOR %s
4 ; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck --check-prefix=INIT-ARRAY %s
5 ; RUN: llc -mtriple x86_64-unknown-freebsd < %s | FileCheck --check-prefix=INIT-ARRAY %s
6 ; RUN: llc -mtriple x86_64-pc-solaris2.11 < %s | FileCheck --check-prefix=INIT-ARRAY %s
7 ; RUN: llc -mtriple x86_64-unknown-nacl < %s | FileCheck --check-prefix=NACL %s
8 ; RUN: llc -mtriple i586-intel-elfiamcu -use-ctors < %s | FileCheck %s --check-prefix=MCU-CTORS
9 ; RUN: llc -mtriple i586-intel-elfiamcu < %s | FileCheck %s --check-prefix=MCU-INIT-ARRAY
10 ; RUN: llc -mtriple x86_64-win32-gnu < %s | FileCheck --check-prefix=COFF-CTOR %s
11 @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null}, { i32, void ()*, i8* } { i32 15, void ()* @g, i8* @v }, { i32, void ()*, i8* } { i32 55555, void ()* @h, i8* @v }]
13 @v = weak_odr global i8 0
30 ; CTOR: .section .ctors.65520,"aGw",@progbits,v,comdat
31 ; CTOR-NEXT: .p2align 3
33 ; CTOR-NEXT: .section .ctors.09980,"aGw",@progbits,v,comdat
34 ; CTOR-NEXT: .p2align 3
36 ; CTOR-NEXT: .section .ctors,"aw",@progbits
37 ; CTOR-NEXT: .p2align 3
40 ; INIT-ARRAY: .section .init_array.15,"aGw",@init_array,v,comdat
41 ; INIT-ARRAY-NEXT: .p2align 3
42 ; INIT-ARRAY-NEXT: .quad g
43 ; INIT-ARRAY-NEXT: .section .init_array.55555,"aGw",@init_array,v,comdat
44 ; INIT-ARRAY-NEXT: .p2align 3
45 ; INIT-ARRAY-NEXT: .quad h
46 ; INIT-ARRAY-NEXT: .section .init_array,"aw",@init_array
47 ; INIT-ARRAY-NEXT: .p2align 3
48 ; INIT-ARRAY-NEXT: .quad f
50 ; NACL: .section .init_array.15,"aGw",@init_array,v,comdat
51 ; NACL-NEXT: .p2align 2
53 ; NACL-NEXT: .section .init_array.55555,"aGw",@init_array,v,comdat
54 ; NACL-NEXT: .p2align 2
56 ; NACL-NEXT: .section .init_array,"aw",@init_array
57 ; NACL-NEXT: .p2align 2
60 ; MCU-CTORS: .section .ctors,"aw",@progbits
61 ; MCU-INIT-ARRAY: .section .init_array,"aw",@init_array
63 ; COFF-CTOR: .section .ctors.65520,"dw",associative,v
64 ; COFF-CTOR-NEXT: .p2align 3
65 ; COFF-CTOR-NEXT: .quad g
66 ; COFF-CTOR-NEXT: .section .ctors.09980,"dw",associative,v
67 ; COFF-CTOR-NEXT: .p2align 3
68 ; COFF-CTOR-NEXT: .quad h
69 ; COFF-CTOR-NEXT: .section .ctors,"dw"
70 ; COFF-CTOR-NEXT: .p2align 3
71 ; COFF-CTOR-NEXT: .quad f