[InstCombine] Signed saturation patterns
[llvm-core.git] / test / Transforms / NewGVN / 2010-05-08-OneBit.ll
blobd4acc188cb298dc048b8ecf66623e37c9e2d068a
1 ; RUN: opt < %s -newgvn
2 ; PR7052
4 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"
5 target triple = "x86_64-unknown-linux-gnu"
7 define i32 @main(i32 %argc, i8** nocapture %argv) personality i32 (...)* @__gxx_personality_v0 {
8 entry:
9   %0 = getelementptr inbounds i8, i8* undef, i64 5    ; <i8*> [#uses=1]
10   %1 = bitcast i8* %0 to i32*                     ; <i32*> [#uses=1]
11   store i32 undef, i32* %1, align 1
12   br i1 undef, label %k121.i.i, label %l117.i.i
14 l117.i.i:                                         ; preds = %entry
15   invoke fastcc void @foo()
16           to label %.noexc5 unwind label %landing_pad
18 .noexc5:                                          ; preds = %l117.i.i
19   unreachable
21 k121.i.i:                                         ; preds = %entry
22   br i1 undef, label %l129.i.i, label %k133.i.i
24 l129.i.i:                                         ; preds = %k121.i.i
25   invoke fastcc void @foo()
26           to label %.noexc7 unwind label %landing_pad
28 .noexc7:                                          ; preds = %l129.i.i
29   unreachable
31 k133.i.i:                                         ; preds = %k121.i.i
32   %2 = getelementptr i8, i8* undef, i64 5             ; <i8*> [#uses=1]
33   %3 = bitcast i8* %2 to i1*                      ; <i1*> [#uses=1]
34   %4 = load i1, i1* %3                                ; <i1> [#uses=1]
35   br i1 %4, label %k151.i.i, label %l147.i.i
37 l147.i.i:                                         ; preds = %k133.i.i
38   invoke fastcc void @foo()
39           to label %.noexc10 unwind label %landing_pad
41 .noexc10:                                         ; preds = %l147.i.i
42   unreachable
44 k151.i.i:                                         ; preds = %k133.i.i
45   ret i32 0
47 landing_pad:                                      ; preds = %l147.i.i, %l129.i.i, %l117.i.i
48   %exn = landingpad {i8*, i32}
49             cleanup
50   switch i32 undef, label %fin [
51     i32 1, label %catch1
52     i32 2, label %catch
53   ]
55 fin:                                              ; preds = %landing_pad
56   unreachable
58 catch:                                            ; preds = %landing_pad
59   ret i32 1
61 catch1:                                           ; preds = %landing_pad
62   ret i32 2
65 declare fastcc void @foo()
67 declare i32 @__gxx_personality_v0(...)