1 ; RUN: llc -mtriple x86_64 < %s | FileCheck --check-prefix=INIT-ARRAY %s
2 ; RUN: llc -mtriple x86_64-pc-linux -use-ctors < %s | FileCheck --check-prefix=CTOR %s
3 ; RUN: llc -mtriple x86_64-unknown-freebsd -use-ctors < %s | FileCheck --check-prefix=CTOR %s
4 ; RUN: llc -mtriple x86_64-pc-solaris2.11 -use-ctors < %s | FileCheck --check-prefix=CTOR %s
5 ; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck --check-prefix=INIT-ARRAY %s
6 ; RUN: llc -mtriple x86_64-unknown-freebsd < %s | FileCheck --check-prefix=INIT-ARRAY %s
7 ; RUN: llc -mtriple x86_64-pc-solaris2.11 < %s | FileCheck --check-prefix=INIT-ARRAY %s
8 ; RUN: llc -mtriple x86_64-unknown-nacl < %s | FileCheck --check-prefix=NACL %s
9 ; RUN: llc -mtriple i586-intel-elfiamcu -use-ctors < %s | FileCheck %s --check-prefix=MCU-CTORS
10 ; RUN: llc -mtriple i586-intel-elfiamcu < %s | FileCheck %s --check-prefix=MCU-INIT-ARRAY
11 ; RUN: llc -mtriple x86_64-win32-gnu < %s | FileCheck --check-prefix=COFF-CTOR %s
12 @llvm.global_ctors = appending global [5 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @f, ptr null}, { i32, ptr, ptr } { i32 15, ptr @g, ptr @v }, { i32, ptr, ptr } { i32 55555, ptr @h, ptr @v }, { i32, ptr, ptr } { i32 65535, ptr @i, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @j, ptr null }]
14 @v = weak_odr global i8 0
41 ; CTOR: .section .ctors,"aw",@progbits
42 ; CTOR-NEXT: .p2align 3
46 ; CTOR-NEXT: .section .ctors.09980,"awG",@progbits,v,comdat
47 ; CTOR-NEXT: .p2align 3
49 ; CTOR-NEXT: .section .ctors.65520,"awG",@progbits,v,comdat
50 ; CTOR-NEXT: .p2align 3
53 ; INIT-ARRAY: .section .init_array.15,"awG",@init_array,v,comdat
54 ; INIT-ARRAY-NEXT: .p2align 3
55 ; INIT-ARRAY-NEXT: .quad g
56 ; INIT-ARRAY-NEXT: .section .init_array.55555,"awG",@init_array,v,comdat
57 ; INIT-ARRAY-NEXT: .p2align 3
58 ; INIT-ARRAY-NEXT: .quad h
59 ; INIT-ARRAY-NEXT: .section .init_array,"aw",@init_array
60 ; INIT-ARRAY-NEXT: .p2align 3
61 ; INIT-ARRAY-NEXT: .quad f
62 ; INIT-ARRAY-NEXT: .quad i
63 ; INIT-ARRAY-NEXT: .quad j
65 ; NACL: .section .init_array.15,"awG",@init_array,v,comdat
66 ; NACL-NEXT: .p2align 2
68 ; NACL-NEXT: .section .init_array.55555,"awG",@init_array,v,comdat
69 ; NACL-NEXT: .p2align 2
71 ; NACL-NEXT: .section .init_array,"aw",@init_array
72 ; NACL-NEXT: .p2align 2
77 ; MCU-CTORS: .section .ctors,"aw",@progbits
78 ; MCU-INIT-ARRAY: .section .init_array,"aw",@init_array
80 ; COFF-CTOR: .section .ctors.65520,"dw",associative,v
81 ; COFF-CTOR-NEXT: .p2align 3
82 ; COFF-CTOR-NEXT: .quad g
83 ; COFF-CTOR-NEXT: .section .ctors.09980,"dw",associative,v
84 ; COFF-CTOR-NEXT: .p2align 3
85 ; COFF-CTOR-NEXT: .quad h
86 ; COFF-CTOR-NEXT: .section .ctors,"dw"
87 ; COFF-CTOR-NEXT: .p2align 3
88 ; COFF-CTOR-NEXT: .quad f
89 ; COFF-CTOR-NEXT: .quad i
90 ; COFF-CTOR-NEXT: .quad j