| Jakub Kuderski | 638c085 | 2017-08-15 18:14:57 +0000 | [diff] [blame] | 1 | ; XFAIL: * |
| 2 | |
| 3 | ; This test used to generate a region that caused it to delete the entry block, |
| 4 | ; but it does not anymore after the changes to handling of infinite loops in the |
| 5 | ; PostDominatorTree. |
| 6 | ; TODO: This should be either replaced with another IR or deleted completely. |
| 7 | |
| Serge Pavlov | 0668cd2 | 2017-01-10 02:50:47 +0000 | [diff] [blame] | 8 | ; RUN: opt -S -o - -structurizecfg -verify-dom-info < %s | FileCheck %s |
| Matt Arsenault | 6ea0aad | 2013-11-22 19:24:39 +0000 | [diff] [blame] | 9 | |
| 10 | ; CHECK-LABEL: @no_branch_to_entry_undef( |
| 11 | ; CHECK: entry: |
| 12 | ; CHECK-NEXT: br label %entry.orig |
| 13 | define void @no_branch_to_entry_undef(i32 addrspace(1)* %out) { |
| 14 | entry: |
| 15 | br i1 undef, label %for.end, label %for.body |
| 16 | |
| 17 | for.body: ; preds = %entry, %for.body |
| 18 | store i32 999, i32 addrspace(1)* %out, align 4 |
| 19 | br label %for.body |
| 20 | |
| 21 | for.end: ; preds = %Flow |
| 22 | ret void |
| 23 | } |
| 24 | |
| 25 | ; CHECK-LABEL: @no_branch_to_entry_true( |
| 26 | ; CHECK: entry: |
| 27 | ; CHECK-NEXT: br label %entry.orig |
| 28 | define void @no_branch_to_entry_true(i32 addrspace(1)* %out) { |
| 29 | entry: |
| 30 | br i1 true, label %for.end, label %for.body |
| 31 | |
| 32 | for.body: ; preds = %entry, %for.body |
| 33 | store i32 999, i32 addrspace(1)* %out, align 4 |
| 34 | br label %for.body |
| 35 | |
| 36 | for.end: ; preds = %Flow |
| 37 | ret void |
| 38 | } |