define fastcc i8* @t(i32 %base) nounwind {
entry:
-; CHECK: t:
+; CHECK-LABEL: t:
; CHECK: leaq (%rax,%rax,4)
%0 = zext i32 %base to i64
- %1 = getelementptr inbounds %struct.s2* null, i64 %0
+ %1 = getelementptr inbounds %struct.s2, %struct.s2* null, i64 %0
br i1 undef, label %bb1, label %bb2
bb1:
; CHECK-NOT: shlq $9
; CHECK-NOT: leaq
; CHECK: call
- %2 = getelementptr inbounds %struct.s2* null, i64 %0, i32 0
+ %2 = getelementptr inbounds %struct.s2, %struct.s2* null, i64 %0, i32 0
call void @bar(i32* %2) nounwind
unreachable
declare void @printf(...) nounwind
define void @commute(i32 %test_case, i32 %scale) nounwind ssp {
-; CHECK: commute:
+; CHECK-LABEL: commute:
entry:
switch i32 %test_case, label %sw.bb307 [
i32 1, label %sw.bb
]
sw.bb: ; preds = %entry, %entry, %entry
+; CHECK: %sw.bb
+; CHECK: imull
%mul = mul nsw i32 %test_case, 3
%mul20 = mul nsw i32 %mul, %scale
br i1 undef, label %if.end34, label %sw.bb307
if.end34: ; preds = %sw.bb
; CHECK: %if.end34
-; CHECK: imull
; CHECK: leal
; CHECK-NOT: imull
- tail call void (...)* @printf(i32 %test_case, i32 %mul20) nounwind
+ tail call void (...) @printf(i32 %test_case, i32 %mul20) nounwind
%tmp = mul i32 %scale, %test_case
%tmp752 = mul i32 %tmp, 3
%tmp753 = zext i32 %tmp752 to i64
; rdar://10660865
define i32 @cross_mbb_phys_cse(i32 %a, i32 %b) nounwind ssp {
entry:
-; CHECK: cross_mbb_phys_cse:
+; CHECK-LABEL: cross_mbb_phys_cse:
; CHECK: cmpl
; CHECK: ja
%cmp = icmp ugt i32 %a, %b
br i1 %cmp3, label %return, label %do.cond
do.cond:
- %incdec.ptr = getelementptr inbounds i8* %p.0, i64 1
+ %incdec.ptr = getelementptr inbounds i8, i8* %p.0, i64 1
%dec = add i64 %n.addr.0, -1
%cmp6 = icmp eq i64 %dec, 0
br i1 %cmp6, label %return, label %do.body
%retval.0 = phi i8* [ null, %entry ], [ null, %do.cond ], [ %p.0, %do.body ]
ret i8* %retval.0
}
+
+; PR13578
+@t2_global = external global i32
+
+declare i1 @t2_func()
+
+define i32 @t2() {
+ store i32 42, i32* @t2_global
+ %c = call i1 @t2_func()
+ br i1 %c, label %a, label %b
+
+a:
+ %l = load i32, i32* @t2_global
+ ret i32 %l
+
+b:
+ ret i32 0
+
+; CHECK-LABEL: t2:
+; CHECK: t2_global@GOTPCREL(%rip)
+; CHECK-NOT: t2_global@GOTPCREL(%rip)
+}