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 [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 14@v = weak_odr global i8 0 15 16define void @f() { 17entry: 18 ret void 19} 20 21define void @g() { 22entry: 23 ret void 24} 25 26define void @h() { 27entry: 28 ret void 29} 30 31; CTOR: .section .ctors.65520,"aGw",@progbits,v,comdat 32; CTOR-NEXT: .p2align 3 33; CTOR-NEXT: .quad g 34; CTOR-NEXT: .section .ctors.09980,"aGw",@progbits,v,comdat 35; CTOR-NEXT: .p2align 3 36; CTOR-NEXT: .quad h 37; CTOR-NEXT: .section .ctors,"aw",@progbits 38; CTOR-NEXT: .p2align 3 39; CTOR-NEXT: .quad f 40 41; INIT-ARRAY: .section .init_array.15,"aGw",@init_array,v,comdat 42; INIT-ARRAY-NEXT: .p2align 3 43; INIT-ARRAY-NEXT: .quad g 44; INIT-ARRAY-NEXT: .section .init_array.55555,"aGw",@init_array,v,comdat 45; INIT-ARRAY-NEXT: .p2align 3 46; INIT-ARRAY-NEXT: .quad h 47; INIT-ARRAY-NEXT: .section .init_array,"aw",@init_array 48; INIT-ARRAY-NEXT: .p2align 3 49; INIT-ARRAY-NEXT: .quad f 50 51; NACL: .section .init_array.15,"aGw",@init_array,v,comdat 52; NACL-NEXT: .p2align 2 53; NACL-NEXT: .long g 54; NACL-NEXT: .section .init_array.55555,"aGw",@init_array,v,comdat 55; NACL-NEXT: .p2align 2 56; NACL-NEXT: .long h 57; NACL-NEXT: .section .init_array,"aw",@init_array 58; NACL-NEXT: .p2align 2 59; NACL-NEXT: .long f 60 61; MCU-CTORS: .section .ctors,"aw",@progbits 62; MCU-INIT-ARRAY: .section .init_array,"aw",@init_array 63 64; COFF-CTOR: .section .ctors.65520,"dw",associative,v 65; COFF-CTOR-NEXT: .p2align 3 66; COFF-CTOR-NEXT: .quad g 67; COFF-CTOR-NEXT: .section .ctors.09980,"dw",associative,v 68; COFF-CTOR-NEXT: .p2align 3 69; COFF-CTOR-NEXT: .quad h 70; COFF-CTOR-NEXT: .section .ctors,"dw" 71; COFF-CTOR-NEXT: .p2align 3 72; COFF-CTOR-NEXT: .quad f 73