Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenObjC / terminate.m
blob26242549bcd7ef7a785721b9b28eccfce2d62107
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
4 void destroy(void**);
6 void test0(void) {
7   void test0_helper(void);
8   void *ptr __attribute__((cleanup(destroy)));
9   test0_helper();
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()
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()