mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 15:19:33 +00:00
test that the ptr-to-method is succefully eliminated, leaving just the vtable dispatch.
llvm-svn: 41047
This commit is contained in:
parent
8674db5fbf
commit
a41b2e2d2f
14
test/C++Frontend/ptr-to-method-devirt.cpp
Normal file
14
test/C++Frontend/ptr-to-method-devirt.cpp
Normal file
@ -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)();
|
||||
}
|
Loading…
Reference in New Issue
Block a user