[clang-cl] /EHc should not effect functions with explicit exception specifications
Functions with an explicit exception specification have their behavior
dictated by the specification. The additional /EHc behavior only comes
into play if no exception specification is given.
llvm-svn: 262198
diff --git a/clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp b/clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
index 423c1b7..c660d14 100644
--- a/clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
+++ b/clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
@@ -14,3 +14,18 @@
// CHECK-LABEL: define void @"\01?caller@test1@@YAXXZ"(
// CHECK: call void @never_throws(
// CHECK: invoke void @"\01?may_throw@test1@@YAXXZ"(
+
+namespace test2 {
+struct Cleanup { ~Cleanup(); };
+extern "C" void throws_int() throw(int);
+void may_throw();
+
+void caller() {
+ Cleanup x;
+ throws_int();
+ may_throw();
+}
+}
+// CHECK-LABEL: define void @"\01?caller@test2@@YAXXZ"(
+// CHECK: invoke void @throws_int(
+// CHECK: invoke void @"\01?may_throw@test2@@YAXXZ"(
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index 8a3cb44..e637d7a 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -211,13 +211,13 @@
// RUN: %clang_cl /FI asdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI_ %s
// FI_: "-include" "asdf.h"
-// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=NO-GX %s
+// RUN: %clang_cl /TP /c -### -- %s 2>&1 | FileCheck -check-prefix=NO-GX %s
// NO-GX-NOT: "-fcxx-exceptions" "-fexceptions"
-// RUN: %clang_cl /c /GX -### -- %s 2>&1 | FileCheck -check-prefix=GX %s
+// RUN: %clang_cl /TP /c /GX -### -- %s 2>&1 | FileCheck -check-prefix=GX %s
// GX: "-fcxx-exceptions" "-fexceptions"
-// RUN: %clang_cl /c /GX /GX- -### -- %s 2>&1 | FileCheck -check-prefix=GX_ %s
+// RUN: %clang_cl /TP /c /GX /GX- -### -- %s 2>&1 | FileCheck -check-prefix=GX_ %s
// GX_-NOT: "-fcxx-exceptions" "-fexceptions"
// We forward any unrecognized -W diagnostic options to cc1.