diff options
Diffstat (limited to 'test/FrontendC++/ptr-to-method-devirt.cpp')
-rw-r--r-- | test/FrontendC++/ptr-to-method-devirt.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/FrontendC++/ptr-to-method-devirt.cpp b/test/FrontendC++/ptr-to-method-devirt.cpp new file mode 100644 index 0000000..358b801 --- /dev/null +++ b/test/FrontendC++/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)(); + } |