• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
8; RUN: opt -S -o - -structurizecfg -verify-dom-info < %s | FileCheck %s
9
10; CHECK-LABEL: @no_branch_to_entry_undef(
11; CHECK: entry:
12; CHECK-NEXT: br label %entry.orig
13define void @no_branch_to_entry_undef(i32 addrspace(1)* %out) {
14entry:
15  br i1 undef, label %for.end, label %for.body
16
17for.body:                                         ; preds = %entry, %for.body
18  store i32 999, i32 addrspace(1)* %out, align 4
19  br label %for.body
20
21for.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
28define void @no_branch_to_entry_true(i32 addrspace(1)* %out) {
29entry:
30  br i1 true, label %for.end, label %for.body
31
32for.body:                                         ; preds = %entry, %for.body
33  store i32 999, i32 addrspace(1)* %out, align 4
34  br label %for.body
35
36for.end:                                          ; preds = %Flow
37  ret void
38}
39