1// RUN: %clang_cc1 -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.8 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s -check-prefix=CHECK-WITH 2// RUN: %clang_cc1 -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.7 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s -check-prefix=CHECK-WITHOUT 3 4void destroy(void**); 5 6void test0(void) { 7 void test0_helper(void); 8 void *ptr __attribute__((cleanup(destroy))); 9 test0_helper(); 10 11 // CHECK-WITH-LABEL: define{{.*}} void @test0() 12 // CHECK-WITH-SAME: personality ptr @__gcc_personality_v0 13 // CHECK-WITH: [[PTR:%.*]] = alloca ptr, 14 // CHECK-WITH: call void @destroy(ptr noundef [[PTR]]) 15 // CHECK-WITH-NEXT: ret void 16 // CHECK-WITH: invoke void @destroy(ptr noundef [[PTR]]) 17 // CHECK-WITH: landingpad { ptr, i32 } 18 // CHECK-WITH-NEXT: catch ptr null 19 // CHECK-WITH-NEXT: call void @objc_terminate() 20 21 // CHECK-WITHOUT-LABEL: define{{.*}} void @test0() 22 // CHECK-WITHOUT-SAME: personality ptr @__gcc_personality_v0 23 // CHECK-WITHOUT: [[PTR:%.*]] = alloca ptr, 24 // CHECK-WITHOUT: call void @destroy(ptr noundef [[PTR]]) 25 // CHECK-WITHOUT-NEXT: ret void 26 // CHECK-WITHOUT: invoke void @destroy(ptr noundef [[PTR]]) 27 // CHECK-WITHOUT: landingpad { ptr, i32 } 28 // CHECK-WITHOUT-NEXT: catch ptr null 29 // CHECK-WITHOUT-NEXT: call void @abort() 30} 31