summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend/optimization-remark.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Frontend/optimization-remark.c')
-rw-r--r--clang/test/Frontend/optimization-remark.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Frontend/optimization-remark.c b/clang/test/Frontend/optimization-remark.c
new file mode 100644
index 00000000000..d5345b546a5
--- /dev/null
+++ b/clang/test/Frontend/optimization-remark.c
@@ -0,0 +1,19 @@
+// This file tests the -Rpass= flag with the inliner. The test is
+// designed to always trigger the inliner, so it should be independent
+// of the optimization level.
+
+// RUN: %clang -c %s -Rpass=inline -O0 -gline-tables-only -o /dev/null 2> %t.err
+// RUN: FileCheck < %t.err %s --check-prefix=INLINE
+
+// RUN: %clang -c %s -Rpass=inline -O0 -o /dev/null 2> %t.err
+// RUN: FileCheck < %t.err %s --check-prefix=INLINE-NO-LOC
+
+int foo(int x, int y) __attribute__((always_inline));
+
+int foo(int x, int y) { return x + y; }
+int bar(int j) { return foo(j, j - 2); }
+
+// INLINE: remark: foo inlined into bar [-Rpass]
+
+// INLINE-NO-LOC: {{^remark: foo inlined into bar}}
+// INLINE-NO-LOC: note: use -gline-tables-only -gcolumn-info to track
OpenPOWER on IntegriCloud