John McCall | 49e34be | 2011-08-30 01:42:09 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=X86-64 |
| 2 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=X86-32 |
| 3 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=ARM-DARWIN |
| 4 | // RUN: %clang_cc1 -triple arm-unknown-gnueabi -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=ARM-EABI |
| 5 | // RUN: %clang_cc1 -triple mipsel-unknown-unknown -emit-llvm -fcxx-exceptions -fexceptions %s -O2 -o - | FileCheck %s --check-prefix=MIPS |
| 6 | |
| 7 | void foo(); |
| 8 | void test() { |
| 9 | try { |
| 10 | foo(); |
| 11 | } catch (int *&i) { |
| 12 | *i = 5; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | // PR10789: different platforms have different sizes for struct UnwindException. |
| 17 | |
Bill Wendling | 4e1125f | 2013-02-22 09:10:20 +0000 | [diff] [blame] | 18 | // X86-64: [[T0:%.*]] = tail call i8* @__cxa_begin_catch(i8* [[EXN:%.*]]) [[NUW:#[0-9]+]] |
John McCall | 49e34be | 2011-08-30 01:42:09 +0000 | [diff] [blame] | 19 | // X86-64-NEXT: [[T1:%.*]] = getelementptr i8* [[EXN]], i64 32 |
Bill Wendling | 4e1125f | 2013-02-22 09:10:20 +0000 | [diff] [blame] | 20 | // X86-32: [[T0:%.*]] = tail call i8* @__cxa_begin_catch(i8* [[EXN:%.*]]) [[NUW:#[0-9]+]] |
John McCall | 49e34be | 2011-08-30 01:42:09 +0000 | [diff] [blame] | 21 | // X86-32-NEXT: [[T1:%.*]] = getelementptr i8* [[EXN]], i64 32 |
Bill Wendling | 4e1125f | 2013-02-22 09:10:20 +0000 | [diff] [blame] | 22 | // ARM-DARWIN: [[T0:%.*]] = tail call i8* @__cxa_begin_catch(i8* [[EXN:%.*]]) [[NUW:#[0-9]+]] |
John McCall | 49e34be | 2011-08-30 01:42:09 +0000 | [diff] [blame] | 23 | // ARM-DARWIN-NEXT: [[T1:%.*]] = getelementptr i8* [[EXN]], i64 32 |
Bill Wendling | 4e1125f | 2013-02-22 09:10:20 +0000 | [diff] [blame] | 24 | // ARM-EABI: [[T0:%.*]] = tail call i8* @__cxa_begin_catch(i8* [[EXN:%.*]]) [[NUW:#[0-9]+]] |
John McCall | 49e34be | 2011-08-30 01:42:09 +0000 | [diff] [blame] | 25 | // ARM-EABI-NEXT: [[T1:%.*]] = getelementptr i8* [[EXN]], i32 88 |
Bill Wendling | 4e1125f | 2013-02-22 09:10:20 +0000 | [diff] [blame] | 26 | // MIPS: [[T0:%.*]] = tail call i8* @__cxa_begin_catch(i8* [[EXN:%.*]]) [[NUW:#[0-9]+]] |
John McCall | 49e34be | 2011-08-30 01:42:09 +0000 | [diff] [blame] | 27 | // MIPS-NEXT: [[T1:%.*]] = getelementptr i8* [[EXN]], i32 24 |
| 28 | |
Bill Wendling | 4e1125f | 2013-02-22 09:10:20 +0000 | [diff] [blame] | 29 | // X86-64: attributes [[NUW]] = { nounwind } |
| 30 | // X86-32: attributes [[NUW]] = { nounwind } |
| 31 | // ARM-DARWIN: attributes [[NUW]] = { nounwind } |
| 32 | // ARM-EABI: attributes [[NUW]] = { nounwind } |
| 33 | // MIPS: attributes [[NUW]] = { nounwind } |