1 // Verify that remarks for the inliner appear. The remarks under the new PM will
2 // be slightly different than those emitted by the legacy PM. The new PM inliner
3 // also doesnot appear to be added at O0, so we test at O1.
4 // RUN: %clang_cc1 %s -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline -O1 -fexperimental-new-pass-manager -emit-llvm-only -verify -mllvm -mandatory-inlining-first=0
5 // RUN: %clang_cc1 %s -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline -O1 -fexperimental-new-pass-manager -emit-llvm-only -debug-info-kind=line-tables-only -verify -mllvm -mandatory-inlining-first=0
6
7 int foo(int x, int y) __attribute__((always_inline));
foo(int x,int y)8 int foo(int x, int y) { return x + y; }
9
10 float foz(int x, int y) __attribute__((noinline));
foz(int x,int y)11 float foz(int x, int y) { return x * y; }
12
13 // The negative diagnostics are emitted twice because the inliner runs
14 // twice.
15 //
bar(int j)16 int bar(int j) {
17 // expected-remark@+2 {{foz not inlined into bar because it should never be inlined (cost=never)}}
18 // expected-remark@+1 {{foo inlined into bar}}
19 return foo(j, j - 2) * foz(j - 2, j);
20 }
21