1 ; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -o - < %s | FileCheck %s
3 ; This test case was written to trigger an incorrect assert statement in
4 ; -simplifycfg. Thus we don't actually want to check the output, just that
5 ; -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 ran successfully. Thus we only check that the function still
6 ; exists, and that it still calls foo().
8 ; NOTE: There are some obviously dead blocks and missing branch weight
9 ; metadata. Both of these features were key to triggering the assert.
10 ; Additionally, the not-taken weight of the branch with a weight had to
11 ; be 0 to trigger the assert.
13 declare void @foo() nounwind uwtable
15 define void @func(i32 %A) nounwind uwtable {
16 ; CHECK-LABEL: define void @func(
18 %cmp11 = icmp eq i32 %A, 1
19 br i1 %cmp11, label %if.then, label %if.else, !prof !0
23 ; CHECK: call void @foo()
27 %cmp17 = icmp eq i32 %A, 2
28 br i1 %cmp17, label %if.then2, label %if.end
37 !0 = !{!"branch_weights", i32 1, i32 0}