diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-28 22:46:07 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-28 22:46:07 +0000 |
commit | b555a767baf4a1058bc6e4e05acbbee9e55d0e26 (patch) | |
tree | f6da57e020a88e2bfcb717104ec4692ca21a9642 /clang/test/CodeGenCXX/attr.cpp | |
parent | 538fe8f35b26b925e21a4329599c188d48264f0d (diff) | |
download | bcm5719-llvm-b555a767baf4a1058bc6e4e05acbbee9e55d0e26.tar.gz bcm5719-llvm-b555a767baf4a1058bc6e4e05acbbee9e55d0e26.zip |
PR13941: Mark all virtual functions as unnamed_addr. It's not possible to
observe their addresses (taking their address gives the vtable slot) so we are
free to merge their definitions.
llvm-svn: 164864
Diffstat (limited to 'clang/test/CodeGenCXX/attr.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/attr.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/attr.cpp b/clang/test/CodeGenCXX/attr.cpp index 9e8740e5470..a0dd7486013 100644 --- a/clang/test/CodeGenCXX/attr.cpp +++ b/clang/test/CodeGenCXX/attr.cpp @@ -10,17 +10,21 @@ class C { virtual void bar1() __attribute__((aligned(1))); virtual void bar2() __attribute__((aligned(2))); virtual void bar3() __attribute__((aligned(1024))); + void bar4() __attribute__((aligned(1024))); } c; -// CHECK: define void @_ZN1C4bar1Ev(%class.C* %this) nounwind align 2 +// CHECK: define void @_ZN1C4bar1Ev(%class.C* %this) unnamed_addr nounwind align 2 void C::bar1() { } -// CHECK: define void @_ZN1C4bar2Ev(%class.C* %this) nounwind align 2 +// CHECK: define void @_ZN1C4bar2Ev(%class.C* %this) unnamed_addr nounwind align 2 void C::bar2() { } -// CHECK: define void @_ZN1C4bar3Ev(%class.C* %this) nounwind align 1024 +// CHECK: define void @_ZN1C4bar3Ev(%class.C* %this) unnamed_addr nounwind align 1024 void C::bar3() { } +// CHECK: define void @_ZN1C4bar4Ev(%class.C* %this) nounwind align 1024 +void C::bar4() { } + // PR6635 // CHECK: define i32 @_Z5test1v() int test1() { return 10; } |