diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/CodeGenObjCXX/blocks.mm | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'test/CodeGenObjCXX/blocks.mm')
-rw-r--r-- | test/CodeGenObjCXX/blocks.mm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/blocks.mm b/test/CodeGenObjCXX/blocks.mm index 62ae428..63a1b33 100644 --- a/test/CodeGenObjCXX/blocks.mm +++ b/test/CodeGenObjCXX/blocks.mm @@ -8,6 +8,8 @@ @end void f(int (^bl)(B* b)); +void takeBlock(void (^block)()); +void useValues(...); // Test1 void g() { @@ -59,3 +61,25 @@ void gun() { return foovar; }; } + +// PR24780 +class CaptureThisAndAnotherPointer { + void test(void *ptr) { + takeBlock(^{ useValues(ptr, this); }); + } +}; + +// rdar://problem/23713871 +// Check that we don't crash when using BLOCK_LAYOUT_STRONG. +#pragma clang assume_nonnull begin +@interface NSUUID @end +#pragma clang assume_nonnull end + +struct Wrapper1 { NSUUID *Ref; }; +struct Wrapper2 { Wrapper1 W1; }; + +@implementation B +- (void) captureStrongRef { + __block Wrapper2 W2; +} +@end |