Skip to content

Commit e704e94

Browse files
committed
[interop] test, ensure we call copy-constructor when optimizations are enabled in trap-on-exception-execution.swift
1 parent c925237 commit e704e94

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/Interop/Cxx/exceptions/trap-on-exception-execution.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// RUN: %target-codesign %t/trap-exceptions-no-debug
1010
// RUN: %target-run %t/trap-exceptions-no-debug
1111

12-
// RUN: %target-build-swift %s -I %t/Inputs -o %t/trap-exceptions-opt -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -O -DOPTIMIZE
12+
// RUN: %target-build-swift %s -I %t/Inputs -o %t/trap-exceptions-opt -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -O
1313
// RUN: %target-codesign %t/trap-exceptions-opt
1414
// RUN: %target-run %t/trap-exceptions-opt
1515

@@ -93,15 +93,15 @@ TrapOnExecutionTestSuite.test("TestClassWithThrowingDestructor") {
9393
let _ = ClassWithThrowingDestructor()
9494
}
9595

96-
#if OPTIMIZE
97-
#else
9896
TrapOnExecutionTestSuite.test("TestClassWithThrowingCopyConstructor") {
9997
expectCrashLater()
10098
let p1 = ClassWithThrowingCopyConstructor()
101-
let p2 = p1
99+
var p2 = p1
102100
expectEqual(p2.m, 0)
101+
p2.m = 1
102+
expectEqual(p2.m, 1)
103+
expectEqual(p1.m, 0)
103104
}
104-
#endif
105105

106106
TrapOnExecutionTestSuite.test("ClassWithThrowingConstructor") {
107107
expectCrashLater()

0 commit comments

Comments
 (0)