[interop][SwiftToCxx] do not expose functions / properties that throw without the experimental feature

This commit is contained in:
Alex Lorenz
2023-03-02 15:18:09 -08:00
parent 2dcbeb0bc9
commit 1d3797308d
10 changed files with 64 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %S/swift-functions-errors.swift -typecheck -module-name Functions -enable-experimental-cxx-interop -clang-header-expose-decls=has-expose-attr-or-stdlib -emit-clang-header-path %t/functions.h
// RUN: %target-swift-frontend %S/swift-functions-errors.swift -typecheck -module-name Functions -enable-experimental-cxx-interop -clang-header-expose-decls=has-expose-attr-or-stdlib -enable-experimental-feature GenerateBindingsForThrowingFunctionsInCXX -emit-clang-header-path %t/functions.h
// RUN: %target-interop-build-clangxx -c %s -I %t -o %t/swift-functions-errors-execution.o
// RUN: %target-interop-build-swift %S/swift-functions-errors.swift -o %t/swift-functions-errors-execution -Xlinker %t/swift-functions-errors-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain
// RUN: %target-interop-build-swift %S/swift-functions-errors.swift -o %t/swift-functions-errors-execution -Xlinker %t/swift-functions-errors-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain -enable-experimental-feature GenerateBindingsForThrowingFunctionsInCXX
// RUN: %target-codesign %t/swift-functions-errors-execution
// RUN: %target-run %t/swift-functions-errors-execution | %FileCheck %s
@@ -14,6 +14,9 @@
// rdar://102167469
// UNSUPPORTED: CPU=arm64e
// for experimental feature GenerateBindingsForThrowingFunctionsInCXX:
// REQUIRES: asserts
#include <cassert>
#include <cstdio>
#include "functions.h"