Too soon to commit, revert.
[oota-llvm.git] / test / Transforms / GlobalOpt / 2006-07-07-InlineAsmCrash.ll
1 ; RUN: llvm-as< %s | opt -globalopt -disable-output
2 ; PR820
3 target endian = little
4 target pointersize = 32
5 target triple = "i686-pc-linux-gnu"
6         %struct..0FileDescriptor = type { int }
7         "struct.FlagDescription<int32>" = type { ubyte*, int*, bool, bool, int, ubyte* }
8         "struct.FlagRegisterer<bool>" = type { ubyte }
9         %struct.MutexLock = type { %struct..0FileDescriptor* }
10         "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> > > >" }
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> > > >" = 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>" }
12         "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", uint }
13         "struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >" = type { "struct.std::_Rb_tree_node_base"* }
14         "struct.std::_Rb_tree_node_base" = type { uint, "struct.std::_Rb_tree_node_base"*, "struct.std::_Rb_tree_node_base"*, "struct.std::_Rb_tree_node_base"* }
15         "struct.std::_Vector_base<int,std::allocator<int> >" = type { "struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" }
16         "struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl" = type { int*, int*, int* }
17         "struct.std::vector<int,std::allocator<int> >" = type { "struct.std::_Vector_base<int,std::allocator<int> >" }
18 %registry_lock = external global %struct..0FileDescriptor               ; <%struct..0FileDescriptor*> [#uses=0]
19 %_ZN61FLAG__foo_int32_44FLAGS_E = external global "struct.FlagRegisterer<bool>"         ; <"struct.FlagRegisterer<bool>"*> [#uses=0]
20 %llvm.global_ctors = appending global [20 x { int, void ()* }] [ { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN7ScannerC2Ev }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__Z11StripStringPSsPKcc }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_ }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN8Hasher325ResetEj }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__Z25ACLRv }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I_eventbuf }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE }, { int, void ()* } { int 65535, void ()* %_GLOBAL__I__checker_bcad_variable } ]            ; <[20 x { int, void ()* }]*> [#uses=0]
21
22 implementation   ; Functions:
23
24 declare void %_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E()
25
26 declare void %_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E()
27
28 declare void %_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv()
29
30 declare void %_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E()
31
32 declare void %_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E()
33
34 void %_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE() {
35 entry:
36         call void %_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E( )
37         ret void
38 }
39
40 void %_Z12RegisterFlagIiEvPKcRK15FlagDescriptionIT_E() {
41 entry:
42         call void %_ZN9MutexLockC1EP5Mutex( )
43         ret void
44 }
45
46 declare void %_GLOBAL__I__ZN7ScannerC2Ev()
47
48 declare void %_GLOBAL__I__Z11StripStringPSsPKcc()
49
50 void %_ZNSt6vectorIiSaIiEEC1ERKS0_() {
51 entry:
52         unreachable
53 }
54
55 declare void %_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_()
56
57 declare void %_GLOBAL__I__ZN8Hasher325ResetEj()
58
59 declare void %_GLOBAL__I__Z25ACLRv()
60
61 void %_ZN9MutexLockC1EP5Mutex() {
62 entry:
63         call void %_ZN5Mutex4LockEv( )
64         ret void
65 }
66
67 void %_ZN5Mutex4LockEv() {
68 entry:
69         call void %_Z22Acquire_CASPViii( )
70         ret void
71 }
72
73 csretcc void %_ZNSt3mapIPKc15FlagDescriptionIiE9StringCmpSaISt4pairIKS1_S3_EEE3endEv("struct.std::_Rb_tree_const_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >"* %agg.result) {
74 entry:
75         unreachable
76 }
77
78 declare void %_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E()
79
80 void %_Z14CASPViii() {
81 entry:
82         %tmp3 = call int asm sideeffect "lock; cmpxchg $1,$2", "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( int 0, int* null, int 0 )           ; <int> [#uses=0]
83         unreachable
84 }
85
86 declare void %_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E()
87
88 declare void %_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E()
89
90 void %_Z22Acquire_CASPViii() {
91 entry:
92         call void %_Z14CASPViii( )
93         unreachable
94 }
95
96 declare void %_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E()
97
98 declare void %_GLOBAL__I_eventbuf()
99
100 void %_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E() {
101 entry:
102         call void %_Z41__static_initialization_and_destruction_0ii1662( int 1, int 65535 )
103         ret void
104 }
105
106 void %_Z41__static_initialization_and_destruction_0ii1662(int %__initialize_p, int %__priority) {
107 entry:
108         %__initialize_p_addr = alloca int               ; <int*> [#uses=2]
109         %__priority_addr = alloca int           ; <int*> [#uses=2]
110         store int %__initialize_p, int* %__initialize_p_addr
111         store int %__priority, int* %__priority_addr
112         %tmp = load int* %__priority_addr               ; <int> [#uses=1]
113         %tmp = seteq int %tmp, 65535            ; <bool> [#uses=1]
114         br bool %tmp, label %cond_true, label %cond_next14
115
116 cond_true:              ; preds = %entry
117         %tmp8 = load int* %__initialize_p_addr          ; <int> [#uses=1]
118         %tmp9 = seteq int %tmp8, 1              ; <bool> [#uses=1]
119         br bool %tmp9, label %cond_true10, label %cond_next14
120
121 cond_true10:            ; preds = %cond_true
122         call void %_ZN14FlagRegistererIiEC1EPKcRK15FlagDescriptionIiE( )
123         ret void
124
125 cond_next14:            ; preds = %cond_true, %entry
126         ret void
127 }
128
129 declare void %_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E()
130
131 void %_ZN9__gnu_cxx13new_allocatorIPNS_15_Hashtable_nodeIjEEEC2Ev() {
132 entry:
133         unreachable
134 }
135
136 declare void %_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE()
137
138 declare void %_GLOBAL__I__checker_bcad_variable()