[llvm-commits] [llvm] r41047 - /llvm/trunk/test/C++Frontend/ptr-to-method-devirt.cpp
Chris Lattner
sabre at nondot.org
Mon Aug 13 10:17:03 PDT 2007
Author: lattner
Date: Mon Aug 13 12:17:03 2007
New Revision: 41047
URL: http://llvm.org/viewvc/llvm-project?rev=41047&view=rev
Log:
test that the ptr-to-method is succefully eliminated, leaving just the vtable dispatch.
Added:
llvm/trunk/test/C++Frontend/ptr-to-method-devirt.cpp
Added: llvm/trunk/test/C++Frontend/ptr-to-method-devirt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/C%2B%2BFrontend/ptr-to-method-devirt.cpp?rev=41047&view=auto
==============================================================================
--- llvm/trunk/test/C++Frontend/ptr-to-method-devirt.cpp (added)
+++ llvm/trunk/test/C++Frontend/ptr-to-method-devirt.cpp Mon Aug 13 12:17:03 2007
@@ -0,0 +1,14 @@
+// PR1602
+// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | not grep ptrtoint
+// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | grep getelementptr | count 1
+
+
+struct S { virtual void f(); };
+
+typedef void (S::*P)(void);
+
+const P p = &S::f;
+
+void g(S s) {
+ (s.*p)();
+ }
More information about the llvm-commits
mailing list