diff options
author | John McCall <rjmccall@apple.com> | 2010-08-22 06:43:33 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-22 06:43:33 +0000 |
commit | 1c456c89dc9792e5dc50ccdfc0b738c888de8ca4 (patch) | |
tree | 57609fbd3ebf83ce657ede53bbbd2a0476d8041e /clang/test/CodeGenCXX/member-function-pointers.cpp | |
parent | 84fa510aa9ee3ee97ded906fe4635c2952596fe9 (diff) | |
download | llvm-1c456c89dc9792e5dc50ccdfc0b738c888de8ca4.zip llvm-1c456c89dc9792e5dc50ccdfc0b738c888de8ca4.tar.gz llvm-1c456c89dc9792e5dc50ccdfc0b738c888de8ca4.tar.bz2 |
Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.
Implement ARM ABI semantics for member pointer constants and conversion.
llvm-svn: 111772
Diffstat (limited to 'clang/test/CodeGenCXX/member-function-pointers.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/member-function-pointers.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/member-function-pointers.cpp b/clang/test/CodeGenCXX/member-function-pointers.cpp index e4beee1..c0756fa 100644 --- a/clang/test/CodeGenCXX/member-function-pointers.cpp +++ b/clang/test/CodeGenCXX/member-function-pointers.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin9 | FileCheck %s // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i386-apple-darwin9 | FileCheck -check-prefix LP32 %s +// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-unknown | FileCheck -check-prefix ARM %s struct A { int a; void f(); virtual void vf1(); virtual void vf2(); }; struct B { int b; virtual void g(); }; @@ -190,3 +191,22 @@ namespace PR7027 { struct X { void test( ); }; void testX() { &X::test; } } + +namespace test7 { + struct A { void foo(); virtual void vfoo(); }; + struct B { void foo(); virtual void vfoo(); }; + struct C : A, B { void foo(); virtual void vfoo(); }; + + // CHECK-ARM: @_ZN5test74ptr0E = global {{.*}} { i32 ptrtoint ({{.*}}* @_ZN5test71A3fooEv to i32), i32 0 } + // CHECK-ARM: @_ZN5test74ptr1E = global {{.*}} { i32 ptrtoint ({{.*}}* @_ZN5test71B3fooEv to i32), i32 8 } + // CHECK-ARM: @_ZN5test74ptr2E = global {{.*}} { i32 ptrtoint ({{.*}}* @_ZN5test71C3fooEv to i32), i32 0 } + // CHECK-ARM: @_ZN5test74ptr3E = global {{.*}} { i32 0, i32 1 } + // CHECK-ARM: @_ZN5test74ptr4E = global {{.*}} { i32 0, i32 9 } + // CHECK-ARM: @_ZN5test74ptr5E = global {{.*}} { i32 0, i32 1 } + void (C::*ptr0)() = &A::foo; + void (C::*ptr1)() = &B::foo; + void (C::*ptr2)() = &C::foo; + void (C::*ptr3)() = &A::vfoo; + void (C::*ptr4)() = &B::vfoo; + void (C::*ptr5)() = &C::vfoo; +} |