diff options
author | Shoaib Meenai <smeenai@fb.com> | 2018-06-07 22:54:54 +0000 |
---|---|---|
committer | Shoaib Meenai <smeenai@fb.com> | 2018-06-07 22:54:54 +0000 |
commit | d8d154738742244eef1f9f3c4552ef6ff49a297a (patch) | |
tree | cfb78b3a50b628e3aab83b33adfb4c3abf34956b /clang/test/Frontend/windows-exceptions.cpp | |
parent | 77b5be7ec67254fc27e1626989df00f7f7ec44a5 (diff) | |
download | bcm5719-llvm-d8d154738742244eef1f9f3c4552ef6ff49a297a.tar.gz bcm5719-llvm-d8d154738742244eef1f9f3c4552ef6ff49a297a.zip |
[Frontend] Disallow non-MSVC exception models for windows-msvc targets
The windows-msvc target is used for MSVC ABI compatibility, including
the exceptions model. It doesn't make sense to pair a windows-msvc
target with a non-MSVC exception model. This would previously cause an
assertion failure; explicitly error out for it in the frontend instead.
This also allows us to reduce the matrix of target/exception models a
bit (see the modified tests), and we can possibly simplify some of the
personality code in a follow-up.
Differential Revision: https://reviews.llvm.org/D47853
llvm-svn: 334243
Diffstat (limited to 'clang/test/Frontend/windows-exceptions.cpp')
-rw-r--r-- | clang/test/Frontend/windows-exceptions.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/Frontend/windows-exceptions.cpp b/clang/test/Frontend/windows-exceptions.cpp new file mode 100644 index 00000000000..56316872be4 --- /dev/null +++ b/clang/test/Frontend/windows-exceptions.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple i686--windows-msvc -fsyntax-only %s +// RUN: not %clang_cc1 -triple i686--windows-msvc -fsyntax-only -fdwarf-exceptions %s 2>&1 | FileCheck -check-prefix=MSVC-X86-DWARF %s +// RUN: not %clang_cc1 -triple i686--windows-msvc -fsyntax-only -fseh-exceptions %s 2>&1 | FileCheck -check-prefix=MSVC-X86-SEH %s +// RUN: not %clang_cc1 -triple i686--windows-msvc -fsyntax-only -fsjlj-exceptions %s 2>&1 | FileCheck -check-prefix=MSVC-X86-SJLJ %s + +// RUN: %clang_cc1 -triple x86_64--windows-msvc -fsyntax-only %s +// RUN: not %clang_cc1 -triple x86_64--windows-msvc -fsyntax-only -fdwarf-exceptions %s 2>&1 | FileCheck -check-prefix=MSVC-X64-DWARF %s +// RUN: not %clang_cc1 -triple x86_64--windows-msvc -fsyntax-only -fseh-exceptions %s 2>&1 | FileCheck -check-prefix=MSVC-X64-SEH %s +// RUN: not %clang_cc1 -triple x86_64--windows-msvc -fsyntax-only -fsjlj-exceptions %s 2>&1 | FileCheck -check-prefix=MSVC-X64-SJLJ %s + +// RUN: %clang_cc1 -triple i686--windows-gnu -fsyntax-only %s +// RUN: %clang_cc1 -triple i686--windows-gnu -fsyntax-only -fdwarf-exceptions %s +// RUN: %clang_cc1 -triple i686--windows-gnu -fsyntax-only -fseh-exceptions %s +// RUN: %clang_cc1 -triple i686--windows-gnu -fsyntax-only -fsjlj-exceptions %s + +// RUN: %clang_cc1 -triple x86_64--windows-gnu -fsyntax-only %s +// RUN: %clang_cc1 -triple x86_64--windows-gnu -fsyntax-only -fdwarf-exceptions %s +// RUN: %clang_cc1 -triple x86_64--windows-gnu -fsyntax-only -fseh-exceptions %s +// RUN: %clang_cc1 -triple x86_64--windows-gnu -fsyntax-only -fsjlj-exceptions %s + +// MSVC-X86-DWARF: error: invalid exception model 'fdwarf-exceptions' for target 'i686--windows-msvc' +// MSVC-X86-SEH: error: invalid exception model 'fseh-exceptions' for target 'i686--windows-msvc' +// MSVC-X86-SJLJ: error: invalid exception model 'fsjlj-exceptions' for target 'i686--windows-msvc' + +// MSVC-X64-DWARF: error: invalid exception model 'fdwarf-exceptions' for target 'x86_64--windows-msvc' +// MSVC-X64-SEH: error: invalid exception model 'fseh-exceptions' for target 'x86_64--windows-msvc' +// MSVC-X64-SJLJ: error: invalid exception model 'fsjlj-exceptions' for target 'x86_64--windows-msvc' |