1 ; RUN: opt < %s -passes='require<loops>,gvn' -S | FileCheck %s
2 ; This test is checking that (a) this doesn't crash, and (b) we don't
3 ; conclude the value of %tmp17 is available in bb1.bb15_crit_edge.
6 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"
7 target triple = "x86_64-apple-macosx10.7.0"
8 define i1 @rb_intern(ptr %foo) nounwind ssp {
9 ; CHECK-LABEL: @rb_intern(
12 %tmp = alloca ptr, align 8
13 store ptr null, ptr %tmp, align 8
14 store i8 undef, ptr null, align 536870912
18 br i1 undef, label %bb3, label %bb15
21 ; CHECK: [[TMP:%.*]] = phi ptr [ %tmp14, %bb10 ], [ null, %bb ]
23 ; CHECK: bb1.bb15_crit_edge:
24 ; CHECK: %tmp17.pre = load i8, ptr [[TMP]], align 1
28 br i1 undef, label %bb10, label %bb5
31 br i1 undef, label %bb10, label %bb6
34 %tmp7 = load ptr, ptr %tmp, align 8
35 %tmp8 = load i8, ptr %tmp7, align 1
36 %tmp9 = zext i8 %tmp8 to i64
37 br i1 undef, label %bb15, label %bb10
40 %tmp11 = load ptr, ptr %tmp, align 8
41 %tmp12 = load i8, ptr %tmp11, align 1
42 %tmp13 = zext i8 %tmp12 to i64
43 %tmp14 = getelementptr inbounds i8, ptr %foo, i64 undef
44 store ptr %tmp14, ptr %tmp, align 8
48 %tmp16 = load ptr, ptr %tmp, align 8
49 %tmp17 = load i8, ptr %tmp16, align 1
50 %tmp18 = icmp eq i8 %tmp17, 0
54 ; CHECK: br i1 undef, label %bb15split, label %bb10
56 ; CHECK-LABEL: bb15split: ; preds = %bb6
57 ; CHECK-NEXT: br label %bb15
60 ; CHECK: %tmp17 = phi i8 [ %tmp12.pre3, %bb15split ], [ %tmp17.pre, %bb1.bb15_crit_edge ]
66 declare void @isalnum() nounwind inlinehint ssp