aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C
new file mode 100644
index 000000000..e82a46ebf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C
@@ -0,0 +1,36 @@
+/* { dg-options "-O2 -fdump-tree-einline" } */
+class DocId {
+ public:
+ DocId() { }
+ DocId(const DocId &other) { }
+};
+
+int g;
+class Base {
+ public:
+ virtual void Foo(DocId id) { g++; }
+};
+
+class Super: public Base {
+ public:
+ void Foo(DocId id) { }
+ void Bar(Base *base, DocId id) __attribute__((noinline));
+};
+
+void Super::Bar(Base *base, DocId id) {
+ Super::Foo(id); // direct call is inlined
+ base->Foo(id); // indirect call is marked do not inline
+}
+
+int main(void)
+{
+ Base bah;
+ Super baz;
+ DocId gid;
+
+ baz.Bar(&baz, gid);
+ return 0;
+}
+/* { dg-final-use { scan-tree-dump "Inlining .*Super::Foo" "einline" } } */
+/* { dg-final-use { scan-tree-dump-not "mismatched arguments" "einline" } } */
+/* { dg-final-use { cleanup-tree-dump "einline" } } */