blob: d5345b546a5af670845039a33e119c5558dc09a1 [file] [log] [blame]
Diego Novillo829b1702014-04-16 16:54:24 +00001// This file tests the -Rpass= flag with the inliner. The test is
2// designed to always trigger the inliner, so it should be independent
3// of the optimization level.
4
5// RUN: %clang -c %s -Rpass=inline -O0 -gline-tables-only -o /dev/null 2> %t.err
6// RUN: FileCheck < %t.err %s --check-prefix=INLINE
7
8// RUN: %clang -c %s -Rpass=inline -O0 -o /dev/null 2> %t.err
9// RUN: FileCheck < %t.err %s --check-prefix=INLINE-NO-LOC
10
11int foo(int x, int y) __attribute__((always_inline));
12
13int foo(int x, int y) { return x + y; }
14int bar(int j) { return foo(j, j - 2); }
15
16// INLINE: remark: foo inlined into bar [-Rpass]
17
18// INLINE-NO-LOC: {{^remark: foo inlined into bar}}
19// INLINE-NO-LOC: note: use -gline-tables-only -gcolumn-info to track