brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 907b17d Raw
55 lines · plain
1; Test that patterns of transformations which disconnect a region of the call2; graph mid-traversal and then invalidate it function correctly.3;4; RUN: opt -S -passes='cgscc(inline,function(simplifycfg))' < %s | FileCheck %s5 6define internal void @test_scc_internal(i1 %flag) {7; CHECK-NOT: @test_scc_internal8entry:9  br i1 %flag, label %then, label %else10 11then:12  call void @test_scc_internal(i1 false)13  call void @test_scc_external()14  br label %else15 16else:17  ret void18}19 20define void @test_scc_external() {21; CHECK-LABEL: define void @test_scc_external()22entry:23  call void @test_scc_internal(i1 false)24  ret void25}26 27define internal void @test_refscc_internal(i1 %flag, ptr %ptr) {28; CHECK-NOT: @test_refscc_internal29entry:30  br i1 %flag, label %then, label %else31 32then:33  call void @test_refscc_internal(i1 false, ptr @test_refscc_external)34  br label %else35 36else:37  ret void38}39 40define ptr @test_refscc_external() {41; CHECK-LABEL: define ptr @test_refscc_external()42entry:43  br i1 true, label %then, label %else44; CHECK-NEXT:  entry:45; CHECK-NEXT:    ret ptr null46; CHECK-NEXT:  }47; CHECK-NOT: @test_refscc_internal48 49then:50  ret ptr null51 52else:53  ret ptr @test_refscc_internal54}55