diff options
Diffstat (limited to 'test/CodeGenCXX/member-function-pointers.cpp')
-rw-r--r-- | test/CodeGenCXX/member-function-pointers.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp index 7792560..05bf396 100644 --- a/test/CodeGenCXX/member-function-pointers.cpp +++ b/test/CodeGenCXX/member-function-pointers.cpp @@ -34,6 +34,11 @@ void f() { // CHECK: [[ADJ:%[a-zA-Z0-9\.]+]] = add i64 {{.*}}, 16 // CHECK: store i64 [[ADJ]], i64* getelementptr inbounds (%0* @pc, i32 0, i32 1) pc = pa; + + // CHECK: store i64 {{.*}}, i64* getelementptr inbounds (%0* @pa, i32 0, i32 0) + // CHECK: [[ADJ:%[a-zA-Z0-9\.]+]] = sub i64 {{.*}}, 16 + // CHECK: store i64 [[ADJ]], i64* getelementptr inbounds (%0* @pa, i32 0, i32 1) + pa = static_cast<void (A::*)()>(pc); } void f2() { @@ -55,6 +60,10 @@ void f3(A *a, A &ar) { (ar.*pa)(); } +bool f4() { + return pa; +} + // PR5177 namespace PR5177 { struct A { @@ -87,3 +96,12 @@ namespace PR5138 { void (foo::*ptr3)(void) = (void (foo::*)(void))&foo::bar; } + +// PR5593 +namespace PR5593 { + struct A { }; + + bool f(void (A::*f)()) { + return f && f; + } +} |