1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -o - %s | FileCheck -check-prefix=CHECK-UNOPT %s 2*f4a2713aSLionel Sambuc// rdar://12530881 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambucvoid test19() { 5*f4a2713aSLionel Sambuc __block id x; 6*f4a2713aSLionel Sambuc// CHECK-UNOPT-LABEL: define internal void @__Block_byref_object_copy 7*f4a2713aSLionel Sambuc// CHECK-UNOPT: [[X:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR:%.*]], i32 0, i32 6 8*f4a2713aSLionel Sambuc// CHECK-UNOPT: [[X2:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR1:%.*]], i32 0, i32 6 9*f4a2713aSLionel Sambuc// CHECK-UNOPT-NEXT: [[SIX:%.*]] = load i8** [[X2]], align 8 10*f4a2713aSLionel Sambuc// CHECK-UNOPT-NEXT: store i8* null, i8** [[X]], align 8 11*f4a2713aSLionel Sambuc// CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X]], i8* [[SIX]]) [[NUW:#[0-9]+]] 12*f4a2713aSLionel Sambuc// CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X2]], i8* null) [[NUW]] 13*f4a2713aSLionel Sambuc// CHECK-UNOPT-NEXT: ret void 14*f4a2713aSLionel Sambuc} 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc// CHECK: attributes [[NUW]] = { nounwind } 17