diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
commit | fd035e6496665b1f1197868e21cb0a4594e8db6e (patch) | |
tree | 53010172e19c77ea447bcd89e117cda052ab52e0 /test/CodeGenCXX/member-function-pointers.cpp | |
parent | 2fce988e86bc01829142e4362d4eff1af0925147 (diff) | |
download | FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.zip FreeBSD-src-fd035e6496665b1f1197868e21cb0a4594e8db6e.tar.gz |
Update clang to r96341.
Diffstat (limited to 'test/CodeGenCXX/member-function-pointers.cpp')
-rw-r--r-- | test/CodeGenCXX/member-function-pointers.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp index e1353a7..f7c445b 100644 --- a/test/CodeGenCXX/member-function-pointers.cpp +++ b/test/CodeGenCXX/member-function-pointers.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin9 | FileCheck %s -struct A { int a; void f(); virtual void vf(); }; +struct A { int a; void f(); virtual void vf1(); virtual void vf2(); }; struct B { int b; virtual void g(); }; struct C : B, A { }; @@ -9,17 +9,20 @@ void (A::*volatile vpa)(); void (B::*pb)(); void (C::*pc)(); -// CHECK: @pa2 = global %0 { i64 ptrtoint (void ()* @_ZN1A1fEv to i64), i64 0 }, align 8 +// CHECK: @pa2 = global %0 { i64 ptrtoint (void (%struct.A*)* @_ZN1A1fEv to i64), i64 0 }, align 8 void (A::*pa2)() = &A::f; // CHECK: @pa3 = global %0 { i64 1, i64 0 }, align 8 -void (A::*pa3)() = &A::vf; +void (A::*pa3)() = &A::vf1; -// CHECK: @pc2 = global %0 { i64 ptrtoint (void ()* @_ZN1A1fEv to i64), i64 16 }, align 8 +// CHECK: @pa4 = global %0 { i64 9, i64 0 }, align 8 +void (A::*pa4)() = &A::vf2; + +// CHECK: @pc2 = global %0 { i64 ptrtoint (void (%struct.A*)* @_ZN1A1fEv to i64), i64 16 }, align 8 void (C::*pc2)() = &C::f; // CHECK: @pc3 = global %0 { i64 1, i64 0 }, align 8 -void (A::*pc3)() = &A::vf; +void (A::*pc3)() = &A::vf1; void f() { // CHECK: store i64 0, i64* getelementptr inbounds (%0* @pa, i32 0, i32 0) @@ -43,7 +46,7 @@ void f() { void f2() { // CHECK: [[pa2ptr:%[a-zA-Z0-9\.]+]] = getelementptr inbounds %0* %pa2, i32 0, i32 0 - // CHECK: store i64 ptrtoint (void ()* @_ZN1A1fEv to i64), i64* [[pa2ptr]] + // CHECK: store i64 ptrtoint (void (%struct.A*)* @_ZN1A1fEv to i64), i64* [[pa2ptr]] // CHECK: [[pa2adj:%[a-zA-Z0-9\.]+]] = getelementptr inbounds %0* %pa2, i32 0, i32 1 // CHECK: store i64 0, i64* [[pa2adj]] void (A::*pa2)() = &A::f; @@ -52,7 +55,13 @@ void f2() { // CHECK: store i64 1, i64* [[pa3ptr]] // CHECK: [[pa3adj:%[a-zA-Z0-9\.]+]] = getelementptr inbounds %0* %pa3, i32 0, i32 1 // CHECK: store i64 0, i64* [[pa3adj]] - void (A::*pa3)() = &A::vf; + void (A::*pa3)() = &A::vf1; + + // CHECK: [[pa4ptr:%[a-zA-Z0-9\.]+]] = getelementptr inbounds %0* %pa4, i32 0, i32 0 + // CHECK: store i64 9, i64* [[pa4ptr]] + // CHECK: [[pa4adj:%[a-zA-Z0-9\.]+]] = getelementptr inbounds %0* %pa4, i32 0, i32 1 + // CHECK: store i64 0, i64* [[pa4adj]] + void (A::*pa4)() = &A::vf2; } void f3(A *a, A &ar) { @@ -150,3 +159,17 @@ namespace MemberPointerImpCast { (obj->*method)(); } } + +// PR6258 +namespace PR6258 { + + struct A { + void f(bool); + }; + + void (A::*pf)(bool) = &A::f; + + void f() { + void (A::*pf)(bool) = &A::f; + } +} |