blob: 6330ccdb291432e2fdf88bb4c4c0ae40807896bf [file] [log] [blame]
Benjamin Kramer9b61c552011-02-24 22:46:11 +00001; RUN: opt -S -simplifycfg %s | FileCheck %s
2
3define i8* @test1(i8* %x) nounwind {
4entry:
5 %tmp1 = load i8* %x, align 1
6 %cmp = icmp eq i8 %tmp1, 47
7 br i1 %cmp, label %if.then, label %if.end
8
9if.then:
10 %incdec.ptr = getelementptr inbounds i8* %x, i64 1
11 br label %if.end
12
13if.end:
14 %x.addr = phi i8* [ %incdec.ptr, %if.then ], [ %x, %entry ]
15 ret i8* %x.addr
16
17; CHECK: @test1
18; CHECK: %x.addr = select i1 %cmp, i8* %incdec.ptr, i8* %x
19; CHECK: ret i8* %x.addr
20}