diff options
author | John McCall <rjmccall@apple.com> | 2011-03-15 21:17:48 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-03-15 21:17:48 +0000 |
commit | 8bba1f4ab1f06864fec627befdf7cf8e1ad017be (patch) | |
tree | 5dcf393ab43cd2a863dd6558f6df5688dcca703f /test/CodeGenCXX/member-function-pointers.cpp | |
parent | 4561ecdf27b68d80b3cecc2d80ec32bea0ac2127 (diff) |
Reorganize the emission of (unfoldable) constant casts a bit, and
make sure that upcasts of member pointer types are covered as constants.
Fixed rdar://problem/9130221
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/member-function-pointers.cpp')
-rw-r--r-- | test/CodeGenCXX/member-function-pointers.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp index 78a571e196..011e9cd685 100644 --- a/test/CodeGenCXX/member-function-pointers.cpp +++ b/test/CodeGenCXX/member-function-pointers.cpp @@ -209,3 +209,26 @@ namespace test8 { return pmf(); } } + +namespace test9 { + struct A { + void foo(); + }; + struct B : A { + void foo(); + }; + + typedef void (A::*fooptr)(); + + struct S { + fooptr p; + }; + + // CHECK: define void @_ZN5test94testEv( + // CHECK: alloca i32 + // CHECK-NEXT: ret void + void test() { + int x; + static S array[] = { (fooptr) &B::foo }; + } +} |