1 ; RUN: opt -O2 -S < %s | FileCheck %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
4 target triple = "x86_64-apple-darwin11.1"
6 %"struct.boost::compressed_pair<empty_t,int>" = type { %"struct.boost::details::compressed_pair_imp<empty_t,int,1>" }
7 %"struct.boost::details::compressed_pair_imp<empty_t,int,1>" = type { i32 }
8 %struct.empty_base_t = type <{ i8 }>
9 %struct.empty_t = type <{ i8 }>
11 @.str = private constant [25 x i8] c"x.second() was clobbered\00", align 1 ; <ptr> [#uses=1]
13 define i32 @main(i32 %argc, ptr %argv) ssp {
15 %argc_addr = alloca i32, align 4 ; <ptr> [#uses=1]
16 %argv_addr = alloca ptr, align 8 ; <ptr> [#uses=1]
17 %retval = alloca i32 ; <ptr> [#uses=2]
18 %0 = alloca i32 ; <ptr> [#uses=2]
19 %retval.1 = alloca i8 ; <ptr> [#uses=2]
20 %1 = alloca %struct.empty_base_t ; <ptr> [#uses=1]
21 %2 = alloca ptr ; <ptr> [#uses=1]
22 %x = alloca %"struct.boost::compressed_pair<empty_t,int>" ; <ptr> [#uses=3]
23 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
24 store i32 %argc, ptr %argc_addr
25 store ptr %argv, ptr %argv_addr
26 %3 = call ptr @_ZN5boost15compressed_pairI7empty_tiE6secondEv(ptr %x) ssp ; <ptr> [#uses=1]
27 store i32 -3, ptr %3, align 4
28 %4 = call ptr @_ZN5boost15compressed_pairI7empty_tiE5firstEv(ptr %x) ssp ; <ptr> [#uses=1]
29 store ptr %4, ptr %2, align 8
30 call void @_ZN7empty_tC1Ev(ptr %1) nounwind
31 %5 = call ptr @_ZN5boost15compressed_pairI7empty_tiE6secondEv(ptr %x) ssp ; <ptr> [#uses=1]
32 %6 = load i32, ptr %5, align 4 ; <i32> [#uses=1]
33 %7 = icmp ne i32 %6, -3 ; <i1> [#uses=1]
34 %8 = zext i1 %7 to i8 ; <i8> [#uses=1]
35 store i8 %8, ptr %retval.1, align 1
36 %9 = load i8, ptr %retval.1, align 1 ; <i8> [#uses=1]
37 %toBool = icmp ne i8 %9, 0 ; <i1> [#uses=1]
38 br i1 %toBool, label %bb, label %bb1
41 %10 = call i32 @puts(ptr @.str) ; <i32> [#uses=0]
42 call void @abort() noreturn
46 store i32 0, ptr %0, align 4
47 %11 = load i32, ptr %0, align 4 ; <i32> [#uses=1]
48 store i32 %11, ptr %retval, align 4
51 ; CHECK-NOT: x.second() was clobbered
53 return: ; preds = %bb1
54 %retval2 = load i32, ptr %retval ; <i32> [#uses=1]
58 define linkonce_odr void @_ZN12empty_base_tC2Ev(ptr %this) nounwind ssp align 2 {
60 %this_addr = alloca ptr, align 8 ; <ptr> [#uses=1]
61 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
62 store ptr %this, ptr %this_addr
65 return: ; preds = %entry
69 define linkonce_odr void @_ZN7empty_tC1Ev(ptr %this) nounwind ssp align 2 {
71 %this_addr = alloca ptr, align 8 ; <ptr> [#uses=2]
72 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
73 store ptr %this, ptr %this_addr
74 %0 = load ptr, ptr %this_addr, align 8 ; <ptr> [#uses=1]
75 call void @_ZN12empty_base_tC2Ev(ptr %0) nounwind
78 return: ; preds = %entry
82 define linkonce_odr ptr @_ZN5boost7details19compressed_pair_impI7empty_tiLi1EE6secondEv(ptr %this) nounwind ssp align 2 {
84 %this_addr = alloca ptr, align 8 ; <ptr> [#uses=2]
85 %retval = alloca ptr ; <ptr> [#uses=2]
86 %0 = alloca ptr ; <ptr> [#uses=2]
87 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
88 store ptr %this, ptr %this_addr
89 %1 = load ptr, ptr %this_addr, align 8 ; <ptr> [#uses=1]
90 %2 = getelementptr inbounds %"struct.boost::details::compressed_pair_imp<empty_t,int,1>", ptr %1, i32 0, i32 0 ; <ptr> [#uses=1]
91 store ptr %2, ptr %0, align 8
92 %3 = load ptr, ptr %0, align 8 ; <ptr> [#uses=1]
93 store ptr %3, ptr %retval, align 8
96 return: ; preds = %entry
97 %retval1 = load ptr, ptr %retval ; <ptr> [#uses=1]
101 define linkonce_odr ptr @_ZN5boost15compressed_pairI7empty_tiE6secondEv(ptr %this) ssp align 2 {
103 %this_addr = alloca ptr, align 8 ; <ptr> [#uses=2]
104 %retval = alloca ptr ; <ptr> [#uses=2]
105 %0 = alloca ptr ; <ptr> [#uses=2]
106 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
107 store ptr %this, ptr %this_addr
108 %1 = load ptr, ptr %this_addr, align 8 ; <ptr> [#uses=1]
109 %2 = getelementptr inbounds %"struct.boost::compressed_pair<empty_t,int>", ptr %1, i32 0, i32 0 ; <ptr> [#uses=1]
110 %3 = call ptr @_ZN5boost7details19compressed_pair_impI7empty_tiLi1EE6secondEv(ptr %2) nounwind ; <ptr> [#uses=1]
111 store ptr %3, ptr %0, align 8
112 %4 = load ptr, ptr %0, align 8 ; <ptr> [#uses=1]
113 store ptr %4, ptr %retval, align 8
116 return: ; preds = %entry
117 %retval1 = load ptr, ptr %retval ; <ptr> [#uses=1]
121 define linkonce_odr ptr @_ZN5boost7details19compressed_pair_impI7empty_tiLi1EE5firstEv(ptr %this) nounwind ssp align 2 {
123 %this_addr = alloca ptr, align 8 ; <ptr> [#uses=2]
124 %retval = alloca ptr ; <ptr> [#uses=2]
125 %0 = alloca ptr ; <ptr> [#uses=2]
126 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
127 store ptr %this, ptr %this_addr
128 %1 = load ptr, ptr %this_addr, align 8 ; <ptr> [#uses=1]
129 store ptr %1, ptr %0, align 8
130 %2 = load ptr, ptr %0, align 8 ; <ptr> [#uses=1]
131 store ptr %2, ptr %retval, align 8
134 return: ; preds = %entry
135 %retval1 = load ptr, ptr %retval ; <ptr> [#uses=1]
139 define linkonce_odr ptr @_ZN5boost15compressed_pairI7empty_tiE5firstEv(ptr %this) ssp align 2 {
141 %this_addr = alloca ptr, align 8 ; <ptr> [#uses=2]
142 %retval = alloca ptr ; <ptr> [#uses=2]
143 %0 = alloca ptr ; <ptr> [#uses=2]
144 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
145 store ptr %this, ptr %this_addr
146 %1 = load ptr, ptr %this_addr, align 8 ; <ptr> [#uses=1]
147 %2 = getelementptr inbounds %"struct.boost::compressed_pair<empty_t,int>", ptr %1, i32 0, i32 0 ; <ptr> [#uses=1]
148 %3 = call ptr @_ZN5boost7details19compressed_pair_impI7empty_tiLi1EE5firstEv(ptr %2) nounwind ; <ptr> [#uses=1]
149 store ptr %3, ptr %0, align 8
150 %4 = load ptr, ptr %0, align 8 ; <ptr> [#uses=1]
151 store ptr %4, ptr %retval, align 8
154 return: ; preds = %entry
155 %retval1 = load ptr, ptr %retval ; <ptr> [#uses=1]
159 declare i32 @puts(ptr)
161 declare void @abort() noreturn