diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-13 17:17:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-13 17:17:03 +0000 |
commit | d2953866d60299edd28431f2d47b91e6c8f3f908 (patch) | |
tree | a68ea95b712073790a8a8b6473688c52e05ee0cb /test/C++Frontend | |
parent | fe9d82a71bac418d82f14d28d654dedea66083d5 (diff) |
test that the ptr-to-method is succefully eliminated, leaving just the vtable dispatch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/C++Frontend')
-rw-r--r-- | test/C++Frontend/ptr-to-method-devirt.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/C++Frontend/ptr-to-method-devirt.cpp b/test/C++Frontend/ptr-to-method-devirt.cpp new file mode 100644 index 0000000000..358b801af5 --- /dev/null +++ b/test/C++Frontend/ptr-to-method-devirt.cpp @@ -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)(); + } |