Skip to content

Commit 92b1f09

Browse files
authored
Merge fixes. (#28054)
* Disable expected SILOptimizer test failures. These tests fail because `-enable-ownership-stripping-after-serialization` has been disabled for libswiftCore on tensorflow branch due to SR-11336. TF-799 tracks re-enabling these tests. * Fix libInMemoryFrontend unittests. * Remove test/IRGen/copy_value_destroy_value.sil. The test was deleted upstream in #27866.
1 parent bbc1654 commit 92b1f09

19 files changed

+63
-61
lines changed

test/IRGen/copy_value_destroy_value.sil

Lines changed: 0 additions & 48 deletions
This file was deleted.

test/SILOptimizer/OSLogConstantEvaluableTest.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
//
1111
// REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchos
1212

13-
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
14-
// XFAIL: *
15-
1613
// Test that the functions defined in the OSLogPrototype overlay annotated as
1714
// constant evaluable are so (with the constexpr-limit defined above).
1815
// This test is meant to catch regressions in the OSLog overlay implementation

test/SILOptimizer/OSLogPrototypeCompileTest.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
// whether specific compile-time constants such as the format string,
88
// the size of the byte buffer etc. are literals after the mandatory pipeline.
99

10+
// SWIFT_ENABLE_TENSORFLOW
11+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
12+
// XFAIL: *
13+
1014
import OSLogPrototype
1115

1216
if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {

test/SILOptimizer/constant_evaluable_subset_test.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
//
1919
// RUN: %FileCheck %s < %t/error-output-mandatory
2020

21+
// SWIFT_ENABLE_TENSORFLOW
2122
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
2223
// XFAIL: *
2324

test/SILOptimizer/constant_propagation_diagnostics.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -emit-sil -sdk %S/../SILGen/Inputs %s -o /dev/null -verify
22
// RUN: %target-swift-frontend -enable-ownership-stripping-after-serialization -emit-sil -sdk %S/../SILGen/Inputs %s -o /dev/null -verify
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
// <rdar://problem/18213320> enum with raw values that are too big are not diagnosed
59
enum EnumWithTooLargeElements : UInt8 {
610
case negativeOne = -1 // expected-error 2 {{negative integer '-1' overflows when stored into unsigned type 'UInt8'}}

test/SILOptimizer/definite_init_diagnostics.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify
22
// RUN: %target-swift-frontend -emit-sil -enable-ownership-stripping-after-serialization -primary-file %s -o /dev/null -verify
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
import Swift
59

610
func markUsed<T>(_ t: T) {}

test/SILOptimizer/definite_init_diagnostics_objc.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// RUN: %target-swift-frontend -emit-sil -sdk %S/../SILGen/Inputs %s -I %S/../SILGen/Inputs -enable-source-import -parse-stdlib -o /dev/null -verify -enable-ownership-stripping-after-serialization
33
// REQUIRES: objc_interop
44

5+
// SWIFT_ENABLE_TENSORFLOW
6+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
7+
// XFAIL: *
8+
59
import Swift
610
import gizmo
711

test/SILOptimizer/definite_init_failable_initializers_diagnostics.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -emit-sil -disable-objc-attr-requires-foundation-module -verify %s
22
// RUN: %target-swift-frontend -emit-sil -disable-objc-attr-requires-foundation-module -verify %s -enable-ownership-stripping-after-serialization
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
// High-level tests that DI rejects certain invalid idioms for early
59
// return from initializers.
610

test/SILOptimizer/diagnostic_constant_propagation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// References: <rdar://problem/29937936>,
1010
// <https://bugs.swift.org/browse/SR-5964>
1111

12+
// SWIFT_ENABLE_TENSORFLOW
1213
// TODO(TF-799): Re-enable RUN lines after SR-11336 is fixed.
1314
// XFAIL: *
1415

test/SILOptimizer/diagnostic_constant_propagation_int_arch64.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
//
1414
// FIXME: <rdar://problem/39193272> A false negative that happens only in REPL
1515

16+
// SWIFT_ENABLE_TENSORFLOW
17+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
18+
// XFAIL: *
19+
1620
import StdlibUnittest
1721

1822
func testArithmeticOverflow_Int_64bit() {

test/SILOptimizer/exclusivity_static_diagnostics.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -enforce-exclusivity=checked -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify
22
// RUN: %target-swift-frontend -enforce-exclusivity=checked -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify -enable-ownership-stripping-after-serialization
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
import Swift
59

610
func takesTwoInouts<T>(_ p1: inout T, _ p2: inout T) { }

test/SILOptimizer/exclusivity_static_diagnostics_objc.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -import-objc-header %S/Inputs/optional_closure_bridging.h -enforce-exclusivity=checked -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify -enable-ownership-stripping-after-serialization
33
// REQUIRES: objc_interop
44

5+
// SWIFT_ENABLE_TENSORFLOW
6+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
7+
// XFAIL: *
8+
59
import Foundation
610

711
class SomeClass {

test/SILOptimizer/generalized_accessors.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
//
44
// Tests for yield-once diagnostics emitted for generalized accessors.
55

6+
// SWIFT_ENABLE_TENSORFLOW
7+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
8+
// XFAIL: *
9+
610
struct TestNoYield {
711
var computed: Int {
812
_read {

test/SILOptimizer/infinite_recursion.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify
22
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify -enable-ownership-stripping-after-serialization
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
func a() { // expected-warning {{all paths through this function will call itself}}
59
a()
610
}

test/SILOptimizer/invalid_escaping_captures.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -emit-sil %s -verify
22
// RUN: %target-swift-frontend -emit-sil %s -verify -enable-ownership-stripping-after-serialization
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
func takesEscaping(_: @escaping () -> ()) {}
59

610
func takesNonEscaping(_ fn: () -> ()) { fn() }

test/SILOptimizer/mandatory_inlining.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -sil-verify-all -primary-file %s -emit-sil -o - -verify | %FileCheck %s
22
// RUN: %target-swift-frontend -sil-verify-all -primary-file %s -emit-sil -o - -verify -enable-ownership-stripping-after-serialization
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
// These tests are deliberately shallow, because I do not want to depend on the
59
// specifics of SIL generation, which might change for reasons unrelated to this
610
// pass

test/SILOptimizer/noescape_param_exclusivity.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %target-swift-frontend -emit-sil %s -verify
22
// RUN: %target-swift-frontend -emit-sil %s -verify -enable-ownership-stripping-after-serialization
33

4+
// SWIFT_ENABLE_TENSORFLOW
5+
// TODO(TF-799): Re-enable test after SR-11336 is fixed.
6+
// XFAIL: *
7+
48
func test0(a: (() -> ()) -> (), b: () -> ()) {
59
a(b) // expected-error {{passing a non-escaping function parameter 'b' to a call to a non-escaping function parameter can allow re-entrant modification of a variable}}
610
}

test/SILOptimizer/pound_assert.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// RUN: %target-swift-frontend -enable-experimental-static-assert -emit-sil %s -verify
2+
// RUN: %target-swift-frontend -enable-experimental-static-assert -enable-ownership-stripping-after-serialization -emit-sil %s -verify
3+
// REQUIRES: asserts
4+
25
// SWIFT_ENABLE_TENSORFLOW
36
// TODO(TF-799): Re-enable RUN line after SR-11336 is fixed.
4-
// UN: %target-swift-frontend -enable-experimental-static-assert -enable-ownership-stripping-after-serialization -emit-sil %s -verify
5-
// REQUIRES: asserts
7+
// XFAIL: *
68

79
//===----------------------------------------------------------------------===//
810
// Basic function calls and control flow

unittests/libInMemoryFrontend/InMemoryFrontendTests.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@ class StreamDiagConsumer : public DiagnosticConsumer {
1515
public:
1616
StreamDiagConsumer(llvm::raw_ostream &OS) : OS(OS) {}
1717

18-
void
19-
handleDiagnostic(SourceManager &SM, SourceLoc Loc, DiagnosticKind Kind,
20-
StringRef FormatString,
21-
ArrayRef<DiagnosticArgument> FormatArgs,
22-
const DiagnosticInfo &Info,
23-
const SourceLoc bufferIndirectlyCausingDiagnostic) override {
24-
switch (Kind) {
18+
void handleDiagnostic(SourceManager &SM,
19+
const DiagnosticInfo &Info) override {
20+
switch (Info.Kind) {
2521
case DiagnosticKind::Error:
2622
OS << "error: ";
2723
break;
@@ -35,7 +31,8 @@ class StreamDiagConsumer : public DiagnosticConsumer {
3531
OS << "remark: ";
3632
break;
3733
}
38-
DiagnosticEngine::formatDiagnosticText(OS, FormatString, FormatArgs);
34+
DiagnosticEngine::formatDiagnosticText(OS, Info.FormatString,
35+
Info.FormatArgs);
3936
}
4037
};
4138

0 commit comments

Comments
 (0)