Fix PR5329: pay attention to constructor/destructor priority
[oota-llvm.git] / test / CodeGen / X86 / 2011-08-29-InitOrder.ll
1 ; RUN: llc < %s -mtriple=i386-linux-gnu | FileCheck %s
2 ; PR5329
3
4 @llvm.global_ctors = appending global [3 x { i32, void ()* }] [{ i32, void ()* } { i32 2000, void ()* @construct_2 }, { i32, void ()* } { i32 3000, void ()* @construct_3 }, { i32, void ()* } { i32 1000, void ()* @construct_1 }]
5 ; CHECK: ctors
6 ; CHECK: construct_3
7 ; CHECK: construct_2
8 ; CHECK: construct_1
9
10 @llvm.global_dtors = appending global [3 x { i32, void ()* }] [{ i32, void ()* } { i32 2000, void ()* @destruct_2 }, { i32, void ()* } { i32 1000, void ()* @destruct_1 }, { i32, void ()* } { i32 3000, void ()* @destruct_3 }]
11 ; CHECK: dtors
12 ; CHECK: destruct_3
13 ; CHECK: destruct_2
14 ; CHECK: destruct_1
15
16 declare void @construct_1()
17 declare void @construct_2()
18 declare void @construct_3()
19 declare void @destruct_1()
20 declare void @destruct_2()
21 declare void @destruct_3()