brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · bb85ace Raw
30 lines · plain
1; Test that all coroutine passes run in the correct order at all optimization2; levels adds coroutine passes to the pipeline.3;4; RUN: opt < %s -disable-output -passes='default<O0>' \5; RUN:     -debug-pass-manager 2>&1 | FileCheck %s --check-prefixes=CHECK-ALL6; RUN: opt < %s -disable-output -passes='default<O1>' \7; RUN:     -debug-pass-manager 2>&1 | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-OPT8; RUN: opt < %s -disable-output -passes='default<O2>' \9; RUN:     -debug-pass-manager 2>&1 | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-OPT10; RUN: opt < %s -disable-output -passes='default<O3>' \11; RUN:     -debug-pass-manager 2>&1 | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-OPT12; RUN: opt < %s -disable-output -debug-pass-manager \13; RUN: -passes='module(coro-early),function(coro-elide),cgscc(coro-split),module(coro-cleanup)' 2>&1 \14; RUN:     | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-OPT15 16; note that we run CoroElidePass before CoroSplitPass. This is because CoroElidePass is part of17; function simplification pipeline, which runs before CoroSplitPass. And since @foo is not18; a coroutine, it won't be put back into the CGSCC, and hence won't trigger a CoroElidePass19; after CoroSplitPass.20; CHECK-ALL: CoroEarlyPass21; CHECK-OPT: CoroElidePass22; CHECK-ALL: CoroSplitPass23; CHECK-ALL: CoroCleanupPass24 25declare token @llvm.coro.id(i32, ptr, ptr, ptr)26 27define void @foo() {28  ret void29}30