Mercurial > hg > CbC > CbC_llvm
comparison clang/test/CodeGenObjC/objc-read-weak-byref.m @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
1 // RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | \ | |
2 // RUN: FileCheck %s | |
3 // RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | \ | |
4 // RUN: FileCheck %s | |
5 | |
6 @interface NSObject | |
7 - copy; | |
8 @end | |
9 | |
10 int main() { | |
11 NSObject *object = 0; | |
12 __weak __block NSObject* weak_object = object; | |
13 void (^callback) (void) = [^{ | |
14 if (weak_object) | |
15 [weak_object copy]; | |
16 } copy]; | |
17 callback(); | |
18 return 0; | |
19 } | |
20 | |
21 // CHECK: call i8* @objc_read_weak | |
22 // CHECK: call i8* @objc_read_weak |