Skip to content

Commit 3c2c7f6

Browse files
authored
Merge pull request #61598 from eeckstein/run-unit-test
Swift Optimizer: make the RunUnitTests a module pass
2 parents 7c3a63b + 5208d6d commit 3c2c7f6

File tree

4 files changed

+3
-11
lines changed

4 files changed

+3
-11
lines changed

SwiftCompilerSources/Sources/Basic/Utils.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import std
2424
public func assert(_ condition: Bool, _ message: @autoclosure () -> String,
2525
file: StaticString = #fileID, line: UInt = #line) {
2626
if !condition {
27-
print("### basic")
2827
fatalError(message(), file: file, line: line)
2928
}
3029
}

SwiftCompilerSources/Sources/Optimizer/TestPasses/RunUnitTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import SIL
1414

1515
/// This pass should only be used by sil-opt to run all the unit tests.
1616
///
17-
let runUnitTests = FunctionPass(name: "run-unit-tests", {
18-
(function: Function, context: PassContext) in
17+
let runUnitTests = ModulePass(name: "run-unit-tests", {
18+
(context: ModulePassContext) in
1919

2020
print("--- Run unit tests ---")
2121

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ PASS(SILDebugInfoGenerator, "sil-debuginfo-gen",
401401
"Generate Debug Information with Source Locations into Textual SIL")
402402
PASS(EarlySROA, "early-sroa",
403403
"Scalar Replacement of Aggregate Stack Objects on high-level SIL")
404-
SWIFT_FUNCTION_PASS(RunUnitTests, "run-unit-tests",
404+
SWIFT_MODULE_PASS(RunUnitTests, "run-unit-tests",
405405
"Runs the compiler internal unit tests")
406406
SWIFT_FUNCTION_PASS(SILPrinter, "sil-printer",
407407
"Test pass which prints the SIL of a function")

test/SILOptimizer/swift-unit-tests.sil

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,3 @@
22

33
// REQUIRES: swift_in_compiler
44

5-
// The RunUnitTests is a function pass. Therefore we need one function is this file to trigger the pass run.
6-
sil @trigger_test_run : $@convention(thin) () -> () {
7-
bb0:
8-
%r = tuple()
9-
return %r : $()
10-
}
11-

0 commit comments

Comments
 (0)