brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · e40b2d7 Raw
42 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=X86-642// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=X86-323// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=ARM-DARWIN4// RUN: %clang_cc1 -triple arm-unknown-gnueabi -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=ARM-EABI5// RUN: %clang_cc1 -triple mipsel-unknown-unknown -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=MIPS6// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -fcxx-exceptions -fexceptions -exception-model=seh %s -O2 -o - | FileCheck %s --check-prefix=MINGW-X86-647// RUN: %clang_cc1 -triple thumbv7-windows-gnu -emit-llvm -fcxx-exceptions -fexceptions -exception-model=seh %s -O2 -o - | FileCheck %s --check-prefix=MINGW-ARMV78 9void foo();10void test() {11  try {12    foo();13  } catch (int *&i) {14    *i = 5;15  }16}17 18// PR10789: different platforms have different sizes for struct UnwindException.19 20// X86-64:          [[T0:%.*]] = tail call ptr @__cxa_begin_catch(ptr [[EXN:%.*]]) [[NUW:#[0-9]+]]21// X86-64-NEXT:     [[T1:%.*]] = getelementptr i8, ptr [[EXN]], i64 3222// X86-32:          [[T0:%.*]] = tail call ptr @__cxa_begin_catch(ptr [[EXN:%.*]]) [[NUW:#[0-9]+]]23// X86-32-NEXT:     [[T1:%.*]] = getelementptr i8, ptr [[EXN]], i64 3224// ARM-DARWIN:      [[T0:%.*]] = tail call ptr @__cxa_begin_catch(ptr [[EXN:%.*]]) [[NUW:#[0-9]+]]25// ARM-DARWIN-NEXT: [[T1:%.*]] = getelementptr i8, ptr [[EXN]], i64 3226// ARM-EABI:        [[T0:%.*]] = tail call ptr @__cxa_begin_catch(ptr [[EXN:%.*]]) [[NUW:#[0-9]+]]27// ARM-EABI-NEXT:   [[T1:%.*]] = getelementptr i8, ptr [[EXN]], i32 8828// MIPS:            [[T0:%.*]] = tail call ptr @__cxa_begin_catch(ptr [[EXN:%.*]]) [[NUW:#[0-9]+]]29// MIPS-NEXT:       [[T1:%.*]] = getelementptr i8, ptr [[EXN]], i32 2430// MINGW-X86-64:     [[T0:%.*]] = tail call ptr @__cxa_begin_catch(ptr [[EXN:%.*]]) [[NUW:#[0-9]+]]31// MINGW-X86-64-NEXT:[[T1:%.*]] = getelementptr i8, ptr [[EXN]], i64 6432// MINGW-ARMV7:      [[T0:%.*]] = tail call arm_aapcs_vfpcc ptr @__cxa_begin_catch(ptr [[EXN:%.*]]) [[NUW:#[0-9]+]]33// MINGW-ARMV7-NEXT: [[T1:%.*]] = getelementptr i8, ptr [[EXN]], i32 4834 35// X86-64: attributes [[NUW]] = { nounwind }36// X86-32: attributes [[NUW]] = { nounwind }37// ARM-DARWIN: attributes [[NUW]] = { nounwind }38// ARM-EABI: attributes [[NUW]] = { nounwind }39// MIPS: attributes [[NUW]] = { nounwind }40// MINGW-X86-64: attributes [[NUW]] = { nounwind }41// MINGW-ARMV7: attributes [[NUW]] = { nounwind }42