brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · ba8a04b Raw
68 lines · plain
1// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -fobjc-exceptions -fexceptions -debug-info-kind=line-tables-only -emit-llvm -o - %s | FileCheck %s2 3// CHECK: %[[STRUCT_STRONG:.*]] = type { i32, ptr }4// CHECK: %[[STRUCT_WEAK:.*]] = type { i32, ptr }5 6typedef struct {7  int i;8  id f1;9} Strong;10 11typedef struct {12  int i;13  __weak id f1;14} Weak;15 16// CHECK: define{{.*}} void @testStrongException()17// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_STRONG]], align 818// CHECK: %[[AGG_TMP1:.*]] = alloca %[[STRUCT_STRONG]], align 819// CHECK: %[[CALL:.*]] = call [2 x i64] @genStrong()20// CHECK: store [2 x i64] %[[CALL]], ptr %[[AGG_TMP]], align 821// CHECK: invoke [2 x i64] @genStrong()22 23// CHECK: call void @calleeStrong([2 x i64] %{{.*}}, [2 x i64] %{{.*}})24// CHECK-NEXT: ret void25 26// CHECK: landingpad { ptr, i32 }27// CHECK: call void @__destructor_8_s8(ptr %[[AGG_TMP]]){{.*}}, !dbg [[ARTIFICIAL_LOC_1:![0-9]+]]28// CHECK: br label29 30// CHECK: resume31 32Strong genStrong(void);33void calleeStrong(Strong, Strong);34 35void testStrongException(void) {36  calleeStrong(genStrong(), genStrong());37}38 39// CHECK: define{{.*}} void @testWeakException()40// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_WEAK]], align 841// CHECK: %[[AGG_TMP1:.*]] = alloca %[[STRUCT_WEAK]], align 842// CHECK: call void @genWeak(ptr dead_on_unwind writable sret(%[[STRUCT_WEAK]]) align 8 %[[AGG_TMP]])43// CHECK: invoke void @genWeak(ptr dead_on_unwind writable sret(%[[STRUCT_WEAK]]) align 8 %[[AGG_TMP1]])44 45// CHECK: call void @calleeWeak(ptr dead_on_return noundef %[[AGG_TMP]], ptr dead_on_return noundef %[[AGG_TMP1]])46// CHECK: ret void47 48// CHECK: landingpad { ptr, i32 }49// CHECK: call void @__destructor_8_w8(ptr %[[AGG_TMP]]){{.*}}, !dbg [[ARTIFICIAL_LOC_2:![0-9]+]]50// CHECK: br label51 52// CHECK: resume53 54// CHECK: define{{.*}} void @__destructor_8_w8({{.*}} !dbg ![[DTOR_SP:.*]] {55// CHECK: load ptr, ptr {{.*}}, !dbg ![[DTOR_LOC:.*]]56 57Weak genWeak(void);58void calleeWeak(Weak, Weak);59 60void testWeakException(void) {61  calleeWeak(genWeak(), genWeak());62}63 64// CHECK-DAG: [[ARTIFICIAL_LOC_1]] = !DILocation(line: 065// CHECK-DAG: [[ARTIFICIAL_LOC_2]] = !DILocation(line: 066// CHECK: ![[DTOR_SP]] = distinct !DISubprogram(linkageName: "__destructor_8_w8",67// CHECK: ![[DTOR_LOC]] = !DILocation(line: 0, scope: ![[DTOR_SP]])68