diff options
| author | John McCall <rjmccall@apple.com> | 2011-03-31 08:03:29 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-03-31 08:03:29 +0000 |
| commit | f9b056b00282cda5f0e5bd41a0f768e324f5f26f (patch) | |
| tree | 9c3b7e6a6187298cc6bf7308d68b16c0661875dd /clang/test | |
| parent | 8e4ed855208ff833acee3091d36f89fa59102c9a (diff) | |
| download | bcm5719-llvm-f9b056b00282cda5f0e5bd41a0f768e324f5f26f.tar.gz bcm5719-llvm-f9b056b00282cda5f0e5bd41a0f768e324f5f26f.zip | |
After much contemplation, I've decided that we probably shouldn't "unique"
__block object copy/dispose helpers for C++ objects with those for
different variables with completely different semantics simply because
they happen to both be no more aligned than a pointer.
Found by inspection.
Also, internalize most of the helper generation logic within CGBlocks.cpp,
and refactor it to fit my peculiar aesthetic sense.
llvm-svn: 128618
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CodeGenCXX/blocks.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/blocks.cpp b/clang/test/CodeGenCXX/blocks.cpp index ea174b57e44..d66debea2b9 100644 --- a/clang/test/CodeGenCXX/blocks.cpp +++ b/clang/test/CodeGenCXX/blocks.cpp @@ -55,3 +55,35 @@ namespace test1 { // ...or non-trivial copy constructors, but it's not clear how to do // that and still have a constant initializer in '03. } + +namespace test2 { + struct A { + A(); + A(const A &); + ~A(); + }; + + struct B { + B(); + B(const B &); + ~B(); + }; + + // CHECK: define void @_ZN5test24testEv() + void test() { + __block A a; + __block B b; + } + + // CHECK: define internal void @__Block_byref_object_copy + // CHECK: call void @_ZN5test21AC1ERKS0_( + + // CHECK: define internal void @__Block_byref_object_dispose + // CHECK: call void @_ZN5test21AD1Ev( + + // CHECK: define internal void @__Block_byref_object_copy + // CHECK: call void @_ZN5test21BC1ERKS0_( + + // CHECK: define internal void @__Block_byref_object_dispose + // CHECK: call void @_ZN5test21BD1Ev( +} |

