~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Transforms/SimplifyCFG/select-gep.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: opt -S -simplifycfg < %s | FileCheck %s
 
2
 
 
3
%ST = type { i8, i8 }
 
4
 
 
5
define i8* @test1(%ST* %x, i8* %y) nounwind {
 
6
entry:
 
7
  %cmp = icmp eq %ST* %x, null
 
8
  br i1 %cmp, label %if.then, label %if.end
 
9
 
 
10
if.then:
 
11
  %incdec.ptr = getelementptr %ST, %ST* %x, i32 0, i32 1
 
12
  br label %if.end
 
13
 
 
14
if.end:
 
15
  %x.addr = phi i8* [ %incdec.ptr, %if.then ], [ %y, %entry ]
 
16
  ret i8* %x.addr
 
17
 
 
18
; CHECK-LABEL: @test1(
 
19
; CHECK: %incdec.ptr.y = select i1 %cmp, i8* %incdec.ptr, i8* %y
 
20
; CHECK: ret i8* %incdec.ptr.y
 
21
}