-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75483 from jckarter/move-only-tsan-test-require-6.0
[6.0] Run moveonly checker + TSAN tests in a separate file.
- Loading branch information
Showing
4 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
test/SILOptimizer/moveonly_addresschecker_destructure_through_deinit_diagnostics.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// RUN: %target-swift-emit-sil -sanitize=thread -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses %s -Xllvm -sil-print-final-ossa-module | %FileCheck %s | ||
// RUN: %target-swift-emit-sil -sanitize=thread -O -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses %s | ||
// REQUIRES: OS=macOS | ||
|
||
// This file contains tests that used to crash due to verifier errors. It must | ||
// be separate from moveonly_addresschecker_diagnostics since when we fail on | ||
// the diagnostics in that file, we do not actually run the verifier. | ||
|
||
struct TestTrivialReturnValue : ~Copyable { | ||
var i: Int = 5 | ||
|
||
// We used to error on return buffer. | ||
consuming func drain() -> Int { | ||
let buffer = (consume self).i | ||
self = .init(i: 5) | ||
return buffer | ||
} | ||
} | ||
|
||
|
||
////////////////////// | ||
// MARK: Misc Tests // | ||
////////////////////// | ||
|
||
func testAssertLikeUseDifferentBits() { | ||
struct S : ~Copyable { | ||
var s: [Int] = [] | ||
var currentPosition = 5 | ||
|
||
// CHECK-LABEL: sil private @$s23moveonly_addresschecker30testAssertLikeUseDifferentBitsyyF1SL_V6resume2atySi_tF : $@convention(method) (Int, @inout S) -> () { | ||
// CHECK-NOT: destroy_addr | ||
// CHECK: } // end sil function '$s23moveonly_addresschecker30testAssertLikeUseDifferentBitsyyF1SL_V6resume2atySi_tF' | ||
mutating func resume(at index: Int) { | ||
assert(index >= currentPosition) | ||
currentPosition = index | ||
} | ||
} | ||
} |