92 lines · plain
1; This test uses the same IR functions of the opt-bisect test2; but it checks the correctness of the -opt-disable flag.3; -opt-disable-enable-verbosity is required to have output.4 5; RUN: opt -disable-output -disable-verify \6; RUN: -opt-disable-enable-verbosity \7; RUN: -passes=inferattrs -opt-disable=inferattrs %s 2>&1 \8; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PASS9; CHECK-MODULE-PASS: OptDisable: NOT running pass inferattrs on [module]10 11; RUN: opt -disable-output -disable-verify \12; RUN: -opt-disable-enable-verbosity \13; RUN: -passes=sroa -opt-disable=sroa %s 2>&1 \14; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS15; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f116; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f217; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f318; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f419 20; RUN: opt -disable-output -disable-verify \21; RUN: -opt-disable=inferattrs,function-attrs \22; RUN: -opt-disable-enable-verbosity \23; RUN: -passes='inferattrs,cgscc(function-attrs,function(early-cse))' %s 2>&1 \24; RUN: | FileCheck %s --check-prefix=CHECK-MULTI-PASS25; CHECK-MULTI-PASS: OptDisable: NOT running pass inferattrs on [module]26; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f1)27; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f128; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f2)29; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f230; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f3)31; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f332; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f4)33; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f434 35declare i32 @g()36 37define void @f1(i1 %arg) {38entry:39 br label %loop.040loop.0:41 br i1 %arg, label %loop.0.0, label %loop.142loop.0.0:43 br i1 %arg, label %loop.0.0, label %loop.0.144loop.0.1:45 br i1 %arg, label %loop.0.1, label %loop.046loop.1:47 br i1 %arg, label %loop.1, label %loop.1.bb148loop.1.bb1:49 br i1 %arg, label %loop.1, label %loop.1.bb250loop.1.bb2:51 br i1 %arg, label %end, label %loop.1.052loop.1.0:53 br i1 %arg, label %loop.1.0, label %loop.154end:55 ret void56}57 58define i32 @f2() {59entry:60 ret i32 061}62 63define i32 @f3() {64entry:65 %temp = call i32 @g()66 %icmp = icmp ugt i32 %temp, 267 br i1 %icmp, label %bb.true, label %bb.false68bb.true:69 %temp2 = call i32 @f2()70 ret i32 %temp271bb.false:72 ret i32 073}74 75define void @f4(i1 %arg) {76entry:77 %i = alloca i32, align 478 call void @llvm.lifetime.start(i64 4, ptr %i)79 br label %for.cond80 81for.cond:82 br i1 %arg, label %for.body, label %for.end83 84for.body:85 br label %for.cond86 87for.end:88 ret void89}90 91declare void @llvm.lifetime.start(i64, ptr nocapture)92