2
2
3
3
// 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
4
4
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
6
6
// 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
7
7
8
8
// RUN: %target-codesign %t/swift-expected-execution
@@ -73,24 +73,6 @@ int main() {
73
73
if (testIntValue.value () == 42 )
74
74
printf (" Test get T's Value\n " );
75
75
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
-
94
76
// Test has Value
95
77
if (testIntValue.has_value ())
96
78
printf (" testIntValue has a value\n " );
@@ -107,9 +89,5 @@ int main() {
107
89
// CHECK-NEXT: Test operator bool
108
90
// CHECK-NEXT: Test get T's Value (const)
109
91
// CHECK-NEXT: Test get T's Value
110
- // CHECK-NEXT: passThrowFunctionWithPossibleReturn
111
- // CHECK-NEXT: returnError
112
- // CHECK-NEXT: passThrowFunctionWithPossibleReturn
113
- // CHECK-NEXT: returnError
114
92
// CHECK-NEXT: testIntValue has a value
115
93
// CHECK-NEXT: testIntError doesn't have a value
0 commit comments