1 ; Test CFG simplify removal of branch instructions.
3 ; RUN: opt < %s -simplifycfg -S | FileCheck %s
4 ; RUN: opt < %s -passes=simplify-cfg -S | FileCheck %s
10 ; CHECK-NEXT: ret void
13 define void @test2() {
16 ; CHECK-LABEL: @test2(
17 ; CHECK-NEXT: ret void
21 define void @test3(i1 %T) {
22 br i1 %T, label %1, label %1
24 ; CHECK-LABEL: @test3(
25 ; CHECK-NEXT: ret void
30 define void @test5(i32 %A) {
31 switch i32 %A, label %return [
40 return: ; preds = %entry
42 ; CHECK-LABEL: @test5(
43 ; CHECK-NEXT: ret void
49 ; CHECK-LABEL: @test6f
50 ; CHECK: alloca i8, align 1
51 ; CHECK-NEXT: call i8 @test6g
52 ; CHECK-NEXT: icmp eq i8 %tmp, 0
53 ; CHECK-NEXT: load i8, i8* %r, align 1, !dbg !{{[0-9]+$}}
56 %r = alloca i8, align 1
57 %tmp = call i8 @test6g(i8* %r)
58 %tmp1 = icmp eq i8 %tmp, 0
59 br i1 %tmp1, label %bb2, label %bb1
61 %tmp3 = load i8, i8* %r, align 1, !range !2, !tbaa !1, !dbg !5
62 %tmp4 = icmp eq i8 %tmp3, 1
63 br i1 %tmp4, label %bb2, label %bb3
67 %tmp6 = phi i8 [ 0, %bb2 ], [ 1, %bb1 ]
70 declare i8 @test6g(i8*)
73 !llvm.module.flags = !{!8, !9}
78 !3 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !4, subprograms: !4, globals: !4)
80 !5 = !DILocation(line: 23, scope: !6)
81 !6 = !DISubprogram(name: "foo", scope: !3, file: !7, line: 1, type: !DISubroutineType(types: !4), isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !4)
82 !7 = !DIFile(filename: "foo.c", directory: "/")
83 !8 = !{i32 2, !"Dwarf Version", i32 2}
84 !9 = !{i32 2, !"Debug Info Version", i32 3}