xref: /llvm-project/llvm/test/Transforms/Coroutines/smoketest.ll (revision 304838e828f9a0de5594cc203c519cb45867b047)
1; Test that all coroutine passes run in the correct order at all optimization
2; 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-ALL
6; RUN: opt < %s -disable-output -passes='default<O1>' \
7; RUN:     -debug-pass-manager 2>&1 | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-OPT
8; RUN: opt < %s -disable-output -passes='default<O2>' \
9; RUN:     -debug-pass-manager 2>&1 | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-OPT
10; RUN: opt < %s -disable-output -passes='default<O3>' \
11; RUN:     -debug-pass-manager 2>&1 | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-OPT
12; 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-OPT
15
16; note that we run CoroElidePass before CoroSplitPass. This is because CoroElidePass is part of
17; function simplification pipeline, which runs before CoroSplitPass. And since @foo is not
18; a coroutine, it won't be put back into the CGSCC, and hence won't trigger a CoroElidePass
19; after CoroSplitPass.
20; CHECK-ALL: CoroEarlyPass
21; CHECK-OPT: CoroElidePass
22; CHECK-ALL: CoroSplitPass
23; CHECK-ALL: CoroCleanupPass
24
25declare token @llvm.coro.id(i32, ptr, ptr, ptr)
26
27define void @foo() {
28  ret void
29}
30