208fe86402ce5e5f7d72c12c98501a491a58ee5c
[oota-llvm.git] / test / Linker / ctors.ll
1 ; RUN: llvm-link %s %p/Inputs/ctors.ll -S -o - | \
2 ; RUN:   FileCheck --check-prefix=ALL --check-prefix=CHECK1 %s
3 ; RUN: llvm-link %p/Inputs/ctors.ll %s -S -o - | \
4 ; RUN:   FileCheck --check-prefix=ALL --check-prefix=CHECK2 %s
5
6 ; Test the bitcode writer too. It used to crash.
7 ; RUN: llvm-link %s %p/Inputs/ctors.ll -o t.bc
8
9 @v = weak global i8 0
10 ; CHECK1: @v = weak global i8 0
11 ; CHECK2: @v = weak global i8 1
12
13 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* @v }]
14 ; ALL: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* @v }]
15
16 define weak void @f() {
17   ret void
18 }