[SimplifyLibCalls] Remove useless bits of this tests.
[oota-llvm.git] / test / Transforms / InstCombine / token.ll
1 ; RUN: opt < %s -instcombine -S | FileCheck %s
2 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-pc-windows-msvc18.0.0"
4
5 declare i32 @__CxxFrameHandler3(...)
6
7 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
8 bb:
9   unreachable
10
11 unreachable:
12   %cl = cleanuppad []
13   cleanupret %cl unwind to caller
14 }
15
16 ; CHECK-LABEL: define void @test1(
17 ; CHECK: unreachable:
18 ; CHECK:   %cl = cleanuppad []
19 ; CHECK:   cleanupret %cl unwind to caller
20
21 define void @test2(i8 %A, i8 %B) personality i32 (...)* @__CxxFrameHandler3 {
22 bb:
23   %X = zext i8 %A to i32
24   invoke void @g(i32 0)
25     to label %cont
26     unwind label %catch
27
28 cont:
29   %Y = zext i8 %B to i32
30   invoke void @g(i32 0)
31     to label %unreachable
32     unwind label %catch
33
34 catch:
35   %phi = phi i32 [ %X, %bb ], [ %Y, %cont ]
36   %cl = catchpad []
37    to label %doit
38    unwind label %endpad
39
40 doit:
41   call void @g(i32 %phi)
42   unreachable
43
44 unreachable:
45   unreachable
46
47 endpad:
48   catchendpad unwind to caller
49 }
50
51 ; CHECK-LABEL: define void @test2(
52 ; CHECK:  %X = zext i8 %A to i32
53 ; CHECK:  %Y = zext i8 %B to i32
54 ; CHECK:  %phi = phi i32 [ %X, %bb ], [ %Y, %cont ]
55
56 define void @test3(i8 %A, i8 %B) personality i32 (...)* @__CxxFrameHandler3 {
57 bb:
58   %X = zext i8 %A to i32
59   invoke void @g(i32 0)
60     to label %cont
61     unwind label %catch
62
63 cont:
64   %Y = zext i8 %B to i32
65   invoke void @g(i32 0)
66     to label %cont2
67     unwind label %catch
68
69 cont2:
70   invoke void @g(i32 0)
71     to label %unreachable
72     unwind label %catch
73
74 catch:
75   %phi = phi i32 [ %X, %bb ], [ %Y, %cont ], [ %Y, %cont2 ]
76   %cl = catchpad []
77    to label %doit
78    unwind label %endpad
79
80 doit:
81   call void @g(i32 %phi)
82   unreachable
83
84 unreachable:
85   unreachable
86
87 endpad:
88   catchendpad unwind to caller
89 }
90
91 ; CHECK-LABEL: define void @test3(
92 ; CHECK:  %X = zext i8 %A to i32
93 ; CHECK:  %Y = zext i8 %B to i32
94 ; CHECK:  %phi = phi i32 [ %X, %bb ], [ %Y, %cont ], [ %Y, %cont2 ]
95
96
97 declare void @g(i32)