Skip to content

Commit da32ae6

Browse files
authored
Merge pull request swiftlang#21540 from compnerd/better-sil
test: port most SILOptimizer tests for Windows
2 parents 2c259e1 + 2c0999f commit da32ae6

15 files changed

+20
-18
lines changed

test/SILOptimizer/capturepromotion-wrong-lexicalscope.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Make sure project_box gets assigned the correct lexical scope when we create it.
22
// RUN: %target-swift-frontend -primary-file %s -Onone -emit-sil -Xllvm -sil-print-after=capture-promotion -Xllvm \
3-
// RUN: -sil-print-debuginfo -o /dev/null 2>&1 | %FileCheck %s
3+
// RUN: -sil-print-debuginfo -o /dev/null -module-name null 2>&1 | %FileCheck %s
44

55
// CHECK: sil hidden [ossa] @$s4null19captureStackPromoteSiycyF : $@convention(thin) () -> @owned @callee_guaranteed () -> Int {
66
// CHECK: bb0:

test/SILOptimizer/dead_array_elim.sil

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// RUN: %target-sil-opt -sil-print-debuginfo -enable-sil-verify-all -deadobject-elim %s | %FileCheck %s
22

3-
// Linux doesn't have the same symbol name for _ArrayBuffer.
4-
// XFAIL: linux
3+
// Linux doesn't have the same symbol name for _ArrayBuffer, which is part of
4+
// the ObjC runtime interop. Use `_ContiguousArrayBuffer instead.
5+
// REQUIRES: objc_interop
56

67
import Swift
78
import Builtin

test/SILOptimizer/definite-init-wrongscope.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-frontend -primary-file %s -Onone -emit-sil -Xllvm \
22
// RUN: -sil-print-after=raw-sil-inst-lowering -Xllvm \
33
// RUN: -sil-print-only-functions=$s3del1MC4fromAcA12WithDelegate_p_tKcfc \
4-
// RUN: -Xllvm -sil-print-debuginfo -o /dev/null 2>&1 | %FileCheck %s
4+
// RUN: -Xllvm -sil-print-debuginfo -o /dev/null -module-name del 2>&1 | %FileCheck %s
55

66
public protocol DelegateA {}
77
public protocol DelegateB {}

test/SILOptimizer/definite_init_cross_module.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -emit-module-path=%t/OtherModule.swiftmodule %S/Inputs/definite_init_cross_module/OtherModule.swift
3-
// RUN: %target-swift-frontend -emit-sil -verify -I %t -swift-version 5 %s > /dev/null -import-objc-header %S/Inputs/definite_init_cross_module/BridgingHeader.h
3+
// RUN: %target-swift-frontend -emit-sil -verify -I %t -swift-version 5 %s > /dev/null -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %S/Inputs/definite_init_cross_module/BridgingHeader.h
44

55
import OtherModule
66

test/SILOptimizer/definite_init_cross_module_swift4.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -emit-module-path=%t/OtherModule.swiftmodule %S/Inputs/definite_init_cross_module/OtherModule.swift
3-
// RUN: %target-swift-frontend -emit-sil -verify -verify-ignore-unknown -I %t -swift-version 4 %s > /dev/null -import-objc-header %S/Inputs/definite_init_cross_module/BridgingHeader.h
3+
// RUN: %target-swift-frontend -emit-sil -verify -verify-ignore-unknown -I %t -swift-version 4 %s > /dev/null -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %S/Inputs/definite_init_cross_module/BridgingHeader.h
44

55
import OtherModule
66

test/SILOptimizer/devirt_class_witness_method.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all %s -devirtualizer -sil-combine -enable-resilience -save-optimization-record-path=%t.opt.yaml | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all %/s -devirtualizer -sil-combine -enable-resilience -save-optimization-record-path=%t.opt.yaml | %FileCheck %s
22
sil_stage canonical
33
// RUN: %FileCheck -check-prefix=YAML -input-file=%t.opt.yaml %s
44

test/SILOptimizer/devirt_conditional_conformance.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -O -Xllvm -sil-inline-generics=false -Xllvm -sil-disable-pass=GlobalOpt %s -emit-sil -sil-verify-all | tee /tmp/xxx | %FileCheck %s
1+
// RUN: %target-swift-frontend -O -Xllvm -sil-inline-generics=false -Xllvm -sil-disable-pass=GlobalOpt %s -emit-sil -sil-verify-all | %FileCheck %s
22

33

44
public protocol Foo {
@@ -81,4 +81,4 @@ func callFish<T : Fish>(_ x: T) {
8181
// CHECK: return
8282
public func testFish() {
8383
callFish(Outer(x: 0))
84-
}
84+
}

test/SILOptimizer/devirt_speculate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %target-swift-frontend %s -parse-as-library -O -emit-sil -save-optimization-record-path %t.opt.yaml | %FileCheck %s
1+
// RUN: %target-swift-frontend %/s -parse-as-library -O -emit-sil -save-optimization-record-path %t.opt.yaml | %FileCheck %s
22
// RUN: %FileCheck -check-prefix=YAML -input-file=%t.opt.yaml %s
3-
// RUN: %target-swift-frontend %s -parse-as-library -Osize -emit-sil | %FileCheck %s --check-prefix=OSIZE
3+
// RUN: %target-swift-frontend %/s -parse-as-library -Osize -emit-sil | %FileCheck %s --check-prefix=OSIZE
44
//
55
// Test speculative devirtualization.
66

test/SILOptimizer/devirtualize.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all %s -devirtualizer -dce -save-optimization-record-path=%t.yaml | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all %/s -devirtualizer -dce -save-optimization-record-path=%t.yaml | %FileCheck %s
22
// RUN: %FileCheck -check-prefix=YAML -input-file=%t.yaml %s
33

44
sil_stage canonical

test/SILOptimizer/diagnostic_constant_propagation_floats_x86.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify
22
//
33
// REQUIRES: CPU=i386 || CPU=x86_64
4+
// UNSUPPORTED: OS=windows-msvc
45
//
56
// These are tests for diagnostics produced by constant propagation pass
67
// on floating-point operations that are specific to x86 architectures,

0 commit comments

Comments
 (0)