blob: 5559ef18b5b8af8d87e710948ee21ec6802acfa7 [file] [log] [blame]
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00001; RUN: llvm-as < %s | opt -globalopt -disable-output
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; PR820
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00003target datalayout = "e-p:32:32"
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004target triple = "i686-pc-linux-gnu"
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00005 %struct..0FileDescriptor = type { i32 }
6 %"struct.FlagDescription<int32>" = type { i8*, i32*, i1, i1, i32, i8* }
7 %"struct.FlagRegisterer<bool>" = type { i8 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008 %struct.MutexLock = type { %struct..0FileDescriptor* }
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00009 %"struct.std::DisabledRangeMap" = type { %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" }
10 %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >" = type { %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" }
11 %"struct.std::_Rb_tree<const char*,std::pair<const char* const, FlagDescription<bool> >,std::_Select1st<std::pair<const char* const, FlagDescription<bool> > >,StringCmp,std::allocator<std::pair<const char* const, FlagDescription<bool> > > >::_Rb_tree_impl<StringCmp,false>" = type { %"struct.FlagRegisterer<bool>", %"struct.std::_Rb_tree_node_base", i32 }
12 %"struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { %"struct.std::_Rb_tree_node_base"* }
13 %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* }
14 %"struct.std::_Vector_base<int,std::allocator<int> >" = type { %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" }
15 %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" = type { i32*, i32*, i32* }
16 %"struct.std::vector<int,std::allocator<int> >" = type { %"struct.std::_Vector_base<int,std::allocator<int> >" }
17@registry_lock = external global %struct..0FileDescriptor ; <%struct..0FileDescriptor*> [#uses=0]
18@_ZN61FLAG__foo_int32_44FLAGS_E = external global %"struct.FlagRegisterer<bool>" ; <%"struct.FlagRegisterer<bool>"*> [#uses=0]
19@llvm.global_ctors = appending global [20 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN7ScannerC2Ev }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z11StripStringPSsPKcc }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_ }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN8Hasher325ResetEj }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z25ACLRv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_eventbuf }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__checker_bcad_variable } ] ; <[20 x { i32, void ()* }]*> [#uses=0]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000021declare void @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000022
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000023declare void @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000025declare void @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000027declare void @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000028
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000029declare void @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000030
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000031define void @_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000032entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000033 call void @_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +000034 ret void
35}
36
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000037define void @_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000038entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000039 call void @_ZN9MutexLockC1EP5Mutex( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +000040 ret void
41}
42
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000043declare void @_GLOBAL__I__ZN7ScannerC2Ev()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000044
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000045declare void @_GLOBAL__I__Z11StripStringPSsPKcc()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000046
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000047define void @_ZNSt6vectorIiSaIiEEC1ERKS0_() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000048entry:
49 unreachable
50}
51
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000052declare void @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000053
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000054declare void @_GLOBAL__I__ZN8Hasher325ResetEj()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000055
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000056declare void @_GLOBAL__I__Z25ACLRv()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000057
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000058define void @_ZN9MutexLockC1EP5Mutex() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000059entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000060 call void @_ZN5Mutex4LockEv( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +000061 ret void
62}
63
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000064define void @_ZN5Mutex4LockEv() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000065entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000066 call void @_Z22Acquire_CASPViii( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +000067 ret void
68}
69
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000070define void @_ZNSt3mapIPKc15FlagDescriptionIiE9StringCmpSaISt4pairIKS1_S3_EEE3endEv(%"struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >"* sret %agg.result) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000071entry:
72 unreachable
73}
74
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000075declare void @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000076
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000077define void @_Z14CASPViii() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000078entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000079 %tmp3 = call i32 asm sideeffect "lock; cmpxchg $1,$2", "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( i32 0, i32* null, i32 0 ) ; <i32> [#uses=0]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000080 unreachable
81}
82
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000083declare void @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000084
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000085declare void @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000086
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000087define void @_Z22Acquire_CASPViii() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000088entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000089 call void @_Z14CASPViii( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +000090 unreachable
91}
92
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000093declare void @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000094
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000095declare void @_GLOBAL__I_eventbuf()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000096
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000097define void @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000098entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000099 call void @_Z41__static_initialization_and_destruction_0ii1662( i32 1, i32 65535 )
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000100 ret void
101}
102
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000103define void @_Z41__static_initialization_and_destruction_0ii1662(i32 %__initialize_p, i32 %__priority) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000104entry:
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000105 %__initialize_p_addr = alloca i32 ; <i32*> [#uses=2]
106 %__priority_addr = alloca i32 ; <i32*> [#uses=2]
107 store i32 %__initialize_p, i32* %__initialize_p_addr
108 store i32 %__priority, i32* %__priority_addr
109 %tmp = load i32* %__priority_addr ; <i32> [#uses=1]
110 %tmp.upgrd.1 = icmp eq i32 %tmp, 65535 ; <i1> [#uses=1]
111 br i1 %tmp.upgrd.1, label %cond_true, label %cond_next14
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000112
113cond_true: ; preds = %entry
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000114 %tmp8 = load i32* %__initialize_p_addr ; <i32> [#uses=1]
115 %tmp9 = icmp eq i32 %tmp8, 1 ; <i1> [#uses=1]
116 br i1 %tmp9, label %cond_true10, label %cond_next14
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000117
118cond_true10: ; preds = %cond_true
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000119 call void @_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000120 ret void
121
122cond_next14: ; preds = %cond_true, %entry
123 ret void
124}
125
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000126declare void @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E()
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000127
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000128define void @_ZN9__gnu_cxx13new_allocatorIPNS_15_Hashtable_nodeIjEEEC2Ev() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000129entry:
130 unreachable
131}
132
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000133declare void @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE()
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000134
Tanya Lattner4c4d0b82008-03-01 09:15:35 +0000135declare void @_GLOBAL__I__checker_bcad_variable()