brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 93f2179 Raw
31 lines · c
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wno-strict-prototypes -emit-llvm -o - %s -fexceptions -fblocks | FileCheck %s2// RUN: %clang_cc1 -triple armv7-apple-unknown -Wno-strict-prototypes -emit-llvm -o - %s -fexceptions -exception-model=sjlj -fblocks | FileCheck %s -check-prefix=CHECK-ARM3 4void test1(void) {5  extern void test1_helper(void (^)(int));6 7  // CHECK-LABEL:     define{{.*}} void @test1() {{.*}} personality ptr @__gcc_personality_v08  // CHECK-ARM-LABEL: define{{.*}} arm_aapcscc void @test1() {{.*}} personality ptr @__gcc_personality_sj09 10  __block int x = 10;11 12  // CHECK:     invoke void @test1_helper(13  // CHECK-ARM: invoke arm_aapcscc void @test1_helper(14  test1_helper(^(int v) { x = v; });15 16  // CHECK:          landingpad { ptr, i32 }17  // CHECK-NEXT:       cleanup18  // CHECK-ARM:      landingpad { ptr, i32 }19  // CHECK-ARM-NEXT:   cleanup20}21 22void test2_helper();23void test2(void) {24  __block int x = 10;25  ^{ (void)x; };26  test2_helper(5, 6, 7);27}28void test2_helper(int x, int y) {29}30// CHECK: invoke void @test2_helper(i32 noundef 5, i32 noundef 6)31