1 ; RUN: opt -prune-eh -inline -jump-threading -S -enable-new-pm=0 < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 @d = external global i32*, align 8
8 define void @fn3(i1 %B) {
10 br i1 %B, label %if.end, label %if.then
12 if.then: ; preds = %entry
16 if.end: ; preds = %entry
21 define internal void @fn2(i1 %B) unnamed_addr {
26 br i1 %B, label %if.end, label %if.then
34 ; CHECK-LABEL: define internal void @fn2(
35 ; CHECK: %[[LOAD:.*]] = load i32*, i32** @d, align 8
36 ; CHECK: %tobool1.i = icmp eq i32* %[[LOAD]], null
38 define internal void @fn1() unnamed_addr {
42 for.body: ; preds = %entry
43 %0 = load i32*, i32** @d, align 8
44 %tobool1 = icmp eq i32* %0, null
45 br i1 %tobool1, label %cond.false, label %cond.end
47 cond.false: ; preds = %for.body
48 call void @__assert_fail(i8* null)
51 cond.end: ; preds = %for.body
52 %1 = load i32*, i32** @d, align 8
53 %cmp = icmp eq i32* %1, null
54 br i1 %cmp, label %cond.end4, label %cond.false3
56 cond.false3: ; preds = %cond.end
57 call void @__assert_fail(i8* null)
60 cond.end4: ; preds = %cond.end
61 call void @__assert_fail(i8* null)
64 for.end: ; No predecessors!
68 declare void @__assert_fail(i8*)
70 ; Function Attrs: noreturn nounwind
71 declare void @llvm.trap() #0
73 attributes #0 = { noreturn nounwind }