Skip to content

Commit 9feb764

Browse files
committed
[interop] ignore exceptions in existing interop tests
1 parent 355f00c commit 9feb764

23 files changed

+28
-26
lines changed

lib/IRGen/GenStruct.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,12 @@ namespace {
642642
args.push_back(implicitParam);
643643
}
644644
bool canThrow = false;
645-
if (auto *fpt =
646-
destructor->getType()->getAs<clang::FunctionProtoType>()) {
647-
if (!fpt->isNothrow())
648-
canThrow = true;
645+
if (IGF.IGM.isForeignExceptionHandlingEnabled()) {
646+
if (auto *fpt =
647+
destructor->getType()->getAs<clang::FunctionProtoType>()) {
648+
if (!fpt->isNothrow())
649+
canThrow = true;
650+
}
649651
}
650652
if (canThrow) {
651653
IGF.createExceptionTrapScope([&](llvm::BasicBlock *invokeNormalDest,

test/ClangImporter/cxx_interop_ir.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s -Xcc -fignore-exceptions | %FileCheck %s
22

33
// https://github.com/apple/swift/issues/55575
44
// We can't yet call member functions correctly on Windows.

test/Interop/Cxx/class/constructors-irgen-macosx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Target-specific tests for C++ constructor call code generation.
22

3-
// RUN: %swift -module-name MySwift -target x86_64-apple-macosx10.9 -dump-clang-diagnostics -I %S/Inputs -enable-experimental-cxx-interop -emit-ir %s -parse-stdlib -parse-as-library -disable-legacy-type-info | %FileCheck %s -check-prefix=ITANIUM_X64
3+
// RUN: %swift -module-name MySwift -target x86_64-apple-macosx10.9 -dump-clang-diagnostics -I %S/Inputs -enable-experimental-cxx-interop -emit-ir %s -parse-stdlib -parse-as-library -disable-legacy-type-info -Xcc -fignore-exceptions | %FileCheck %s -check-prefix=ITANIUM_X64
44

55
// REQUIRES: OS=macosx
66
// REQUIRES: CPU=x86_64

test/Interop/Cxx/class/constructors-objc-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs -enable-experimental-cxx-interop -emit-ir %s | %FileCheck %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs -enable-experimental-cxx-interop -emit-ir %s -Xcc -fignore-exceptions | %FileCheck %s
22

33
// REQUIRES: CPU=x86_64
44
// REQUIRES: objc_interop

test/Interop/Cxx/class/protocol-conformance-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir -I %S/Inputs -enable-experimental-cxx-interop %s | %FileCheck %s
1+
// RUN: %target-swift-emit-ir -I %S/Inputs -enable-experimental-cxx-interop %s -Xcc -fignore-exceptions | %FileCheck %s
22

33
import ProtocolConformance
44

test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir -Xcc -fignore-exceptions | %FileCheck %s
22

33
// Verify that non-trivial/address-only C++ classes are constructed and accessed
44
// correctly. Make sure that we correctly IRGen functions that construct

test/Interop/Cxx/foreign-reference/move-only-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

test/Interop/Cxx/foreign-reference/pod-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

test/Interop/Cxx/foreign-reference/singleton-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

test/Interop/Cxx/namespace/class-inline-namespace-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: rm -rf %t
22
// RUN: split-file %s %t
3-
// RUN: %target-swift-emit-ir -I %t/Inputs -enable-experimental-cxx-interop %t/test.swift | %FileCheck %t/test.swift
3+
// RUN: %target-swift-emit-ir -I %t/Inputs -enable-experimental-cxx-interop %t/test.swift -Xcc -fignore-exceptions | %FileCheck %t/test.swift
44

55

66
//--- Inputs/module.modulemap

0 commit comments

Comments
 (0)