1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -simplifycfg < %s | FileCheck %s
6 define i8* @test1(%ST* %x, i8* %y) nounwind {
9 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq %ST* [[X:%.*]], null
10 ; CHECK-NEXT: [[INCDEC_PTR:%.*]] = getelementptr [[ST:%.*]], %ST* [[X]], i32 0, i32 1
11 ; CHECK-NEXT: [[INCDEC_PTR_Y:%.*]] = select i1 [[CMP]], i8* [[INCDEC_PTR]], i8* [[Y:%.*]]
12 ; CHECK-NEXT: ret i8* [[INCDEC_PTR_Y]]
15 %cmp = icmp eq %ST* %x, null
16 br i1 %cmp, label %if.then, label %if.end
19 %incdec.ptr = getelementptr %ST, %ST* %x, i32 0, i32 1
23 %x.addr = phi i8* [ %incdec.ptr, %if.then ], [ %y, %entry ]