aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/devirt-12.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ipa/devirt-12.C')
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-12.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-12.C b/gcc/testsuite/g++.dg/ipa/devirt-12.C
new file mode 100644
index 00000000000..2fdf5c49b77
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/devirt-12.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+// { dg-options "-std=c++11 -O -fdump-ipa-inline" }
+
+class Foo
+{
+public:
+ void Bar() const
+ {
+ __builtin_puts ("Howdy!");
+ }
+};
+
+int main()
+{
+ Foo x;
+ auto y = &Foo::Bar;
+ (x.*y)();
+ return 0;
+}
+
+// { dg-final { scan-ipa-dump "Inlined 1 calls, eliminated 1 functions" "inline" } }
+// { dg-final { cleanup-ipa-dump "inline" } }