21 lines · c
1// Verify that remarks for the inliner appear. The remarks under the new PM will2// be slightly different than those emitted by the legacy PM. The new PM inliner3// also does not 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 -emit-llvm-only -verify5// RUN: %clang_cc1 %s -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline -O1 -emit-llvm-only -debug-info-kind=line-tables-only -verify6 7int foo(int x, int y) __attribute__((always_inline));8int foo(int x, int y) { return x + y; }9 10float foz(int x, int y) __attribute__((noinline));11float foz(int x, int y) { return x * y; }12 13// The negative diagnostics are emitted twice because the inliner runs14// twice.15//16int 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