| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| ; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S %s | FileCheck %s |
| |
| @glob = internal constant [5 x ptr] zeroinitializer, align 16 |
| |
| ; Make sure simplifycfg does not crash when dealing with icmp constant |
| ; expressions. |
| define i1 @test(i1 %c) { |
| ; CHECK-LABEL: @test( |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[C:%.*]], i1 false, i1 icmp ugt (ptr inttoptr (i64 -40 to ptr), ptr @glob) |
| ; CHECK-NEXT: ret i1 [[SPEC_SELECT]] |
| ; |
| entry: |
| br i1 %c, label %if.then, label %exit |
| |
| if.then: |
| br label %exit |
| |
| exit: |
| %p = phi i1 [ false, %if.then ], [ icmp ult (ptr @glob, ptr inttoptr (i64 -40 to ptr)), %entry ] |
| ret i1 %p |
| } |