Skip to content

Commit a2633d9

Browse files
[Interop][SwiftToCxx] Fixing swift-expected-execution.cpp test
1 parent 782bc6a commit a2633d9

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

test/Interop/SwiftToCxx/functions/swift-expected-execution.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// RUN: %target-swift-frontend %S/swift-functions-errors.swift -typecheck -module-name Functions -Xcc -fno-exceptions -enable-experimental-cxx-interop -emit-clang-header-path %t/functions.h
44

5-
// RUN: %target-interop-build-clangxx -fno-exceptions -c %s -I %t -fno-exceptions -o %t/swift-expected-execution.o
5+
// RUN: %target-interop-build-clangxx -c %s -I %t -o %t/swift-expected-execution.o
66
// RUN: %target-interop-build-swift %S/swift-functions-errors.swift -o %t/swift-expected-execution -Xlinker %t/swift-expected-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain
77

88
// RUN: %target-codesign %t/swift-expected-execution
@@ -73,24 +73,6 @@ int main() {
7373
if (testIntValue.value() == 42)
7474
printf("Test get T's Value\n");
7575

76-
// Test get Swift::Error (const)
77-
const auto constExpectedResult = Functions::throwFunctionWithPossibleReturn(0);
78-
if (!constExpectedResult.has_value()) {
79-
auto constError = constExpectedResult.error(); // using const function
80-
auto optionalError = constError.as<Functions::NaiveErrors>();
81-
auto errorValue = optionalError.get();
82-
errorValue.getMessage();
83-
}
84-
85-
// Test get Swift::Error
86-
auto expectedResult = Functions::throwFunctionWithPossibleReturn(0);
87-
if (!expectedResult.has_value()) {
88-
auto error = expectedResult.error();
89-
auto optionalError = error.as<Functions::NaiveErrors>();
90-
auto errorValue = optionalError.get();
91-
errorValue.getMessage();
92-
}
93-
9476
// Test has Value
9577
if (testIntValue.has_value())
9678
printf("testIntValue has a value\n");
@@ -107,9 +89,5 @@ int main() {
10789
// CHECK-NEXT: Test operator bool
10890
// CHECK-NEXT: Test get T's Value (const)
10991
// CHECK-NEXT: Test get T's Value
110-
// CHECK-NEXT: passThrowFunctionWithPossibleReturn
111-
// CHECK-NEXT: returnError
112-
// CHECK-NEXT: passThrowFunctionWithPossibleReturn
113-
// CHECK-NEXT: returnError
11492
// CHECK-NEXT: testIntValue has a value
11593
// CHECK-NEXT: testIntError doesn't have a value

0 commit comments

Comments
 (0)