Diego Novillo | 829b170 | 2014-04-16 16:54:24 +0000 | [diff] [blame^] | 1 | // 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 | |
| 11 | int foo(int x, int y) __attribute__((always_inline)); |
| 12 | |
| 13 | int foo(int x, int y) { return x + y; } |
| 14 | int 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 |