1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu | FileCheck %s
2 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-f128:128:128-v128:128:128-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
5 define void @foo(i32* %P) #0 {
7 %tobool = icmp eq i32* %P, null
8 br i1 %tobool, label %if.end, label %if.then
10 if.then: ; preds = %entry
11 store i32 0, i32* %P, align 4
14 if.end: ; preds = %entry, %if.then
22 define void @bar(i32* %P, i32* %Q) #0 {
24 %tobool = icmp eq i32* %P, null
25 br i1 %tobool, label %if.else, label %if.then
27 if.then: ; preds = %entry
28 store i32 0, i32* %P, align 4
29 %tobool1 = icmp eq i32* %Q, null
30 br i1 %tobool1, label %if.end3, label %if.then2
32 if.then2: ; preds = %if.then
33 store i32 1, i32* %Q, align 4
36 if.else: ; preds = %entry
37 store i32 0, i32* %Q, align 4
40 if.end3: ; preds = %if.then, %if.then2, %if.else
49 @.str0 = private unnamed_addr constant [2 x i8] c"a\00"
50 @.str1 = private unnamed_addr constant [2 x i8] c"b\00"
51 @.str2 = private unnamed_addr constant [2 x i8] c"c\00"
52 @.str3 = private unnamed_addr constant [2 x i8] c"d\00"
53 @.str4 = private unnamed_addr constant [2 x i8] c"e\00"
54 define i8* @dont_assert(i32 %x) {
55 ; LLVM would assert due to moving an early return into the jump table block and
56 ; removing one of its predecessors despite that block ending with an indirect
59 switch i32 %x, label %sw.epilog [
64 i32 255, label %sw.bb4
66 sw.bb1: br label %return
67 sw.bb2: br label %return
68 sw.bb3: br label %return
69 sw.bb4: br label %return
70 sw.epilog: br label %return
72 %retval.0 = phi i8* [ null, %sw.epilog ],
73 [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str4, i64 0, i64 0), %sw.bb4 ],
74 [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str3, i64 0, i64 0), %sw.bb3 ],
75 [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str2, i64 0, i64 0), %sw.bb2 ],
76 [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str1, i64 0, i64 0), %sw.bb1 ],
77 [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str0, i64 0, i64 0), %entry ]
81 attributes #0 = { nounwind }