• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple x86_64-pc-linux -use-ctors < %s | FileCheck --check-prefix=CTOR %s
2; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck --check-prefix=INIT-ARRAY %s
3; RUN: llc -mtriple x86_64-unknown-nacl < %s | FileCheck --check-prefix=NACL %s
4@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null}, { i32, void ()*, i8* } { i32 15, void ()* @g, i8* @v }]
5
6@v = weak_odr global i8 0
7
8define void @f() {
9entry:
10  ret void
11}
12
13define void @g() {
14entry:
15  ret void
16}
17
18; CTOR:		.section	.ctors.65520,"aGw",@progbits,v,comdat
19; CTOR-NEXT:	.p2align	3
20; CTOR-NEXT:	.quad	g
21; CTOR-NEXT:	.section	.ctors,"aw",@progbits
22; CTOR-NEXT:	.p2align	3
23; CTOR-NEXT:	.quad	f
24
25; INIT-ARRAY:		.section	.init_array.15,"aGw",@init_array,v,comdat
26; INIT-ARRAY-NEXT:	.p2align	3
27; INIT-ARRAY-NEXT:	.quad	g
28; INIT-ARRAY-NEXT:	.section	.init_array,"aw",@init_array
29; INIT-ARRAY-NEXT:	.p2align	3
30; INIT-ARRAY-NEXT:	.quad	f
31
32; NACL:		.section	.init_array.15,"aGw",@init_array,v,comdat
33; NACL-NEXT:	.p2align	2
34; NACL-NEXT:	.long	g
35; NACL-NEXT:	.section	.init_array,"aw",@init_array
36; NACL-NEXT:	.p2align	2
37; NACL-NEXT:	.long	f
38