Skip to content

Commit d5f9dc0

Browse files
committed
---
yaml --- r: 323198 b: refs/heads/tensorflow-next c: 4f48d5e h: refs/heads/master
1 parent 0292ab1 commit d5f9dc0

File tree

14 files changed

+70
-68
lines changed

14 files changed

+70
-68
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,4 +1461,4 @@ refs/heads/master-rebranch: 86e95c23aa0d37f24ec138b7853146c1cead2e40
14611461
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14621462
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14631463
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec
1464-
refs/heads/tensorflow-next: c5a8ee7dc6d6453ec3cc8960c3bde73972034dba
1464+
refs/heads/tensorflow-next: 4f48d5eb855af9c54ab236be53e8e8367d266657

branches/tensorflow-next/test/lit.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ elif run_os in ['windows-msvc']:
927927
config.target_add_rpath = r''
928928

929929
config.target_clang = \
930-
('clang++ -target %s %s' % (config.variant_triple, clang_mcp_opt))
930+
('clang++ -target %s %s -fobjc-runtime=ios-5.0' % (config.variant_triple, clang_mcp_opt))
931931
config.target_ld = \
932932
('%r -libpath:%s' % (config.link, os.path.join(test_resource_dir, \
933933
config.target_sdk_name)))
@@ -1013,7 +1013,7 @@ elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'wi
10131013
'%s -modulewrap -target %s' %
10141014
(config.swiftc, config.variant_triple))
10151015
config.target_clang = (
1016-
"clang++ -target %s %s" %
1016+
"clang++ -target %s %s -fobjc-runtime=ios-5.0" %
10171017
(config.variant_triple, clang_mcp_opt))
10181018
config.target_ld = "ld -L%r" % (make_path(test_resource_dir, config.target_sdk_name))
10191019
elif run_os == 'linux-androideabi' or run_os == 'linux-android':
@@ -1137,7 +1137,8 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
11371137
config.target_clang = ' '.join([
11381138
'clang++',
11391139
'-target', config.variant_triple,
1140-
clang_mcp_opt, android_include_system_paths_opt])
1140+
clang_mcp_opt, android_include_system_paths_opt,
1141+
'-fobjc-runtime=ios-5.0'])
11411142
config.target_ld = ' '.join([
11421143
tools_directory,
11431144
'-L%s' % make_path(test_resource_dir, config.target_sdk_name)])

branches/tensorflow-next/test/lit.site.cfg.in

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,28 @@ config.variant_triple = "@VARIANT_TRIPLE@"
2727
config.variant_sdk = "@VARIANT_SDK@"
2828
config.variant_suffix = "@VARIANT_SUFFIX@"
2929
config.swiftlib_dir = "@LIT_SWIFTLIB_DIR@"
30-
config.swift_stdlib_msvc_runtime = None
31-
if "@SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY@" == "MultiThreaded":
32-
config.swift_stdlib_msvc_runtime = 'MT'
33-
elif "@SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY@" == "MultiThreadedDebug":
34-
config.swift_stdlib_msvc_runtime = 'MTd'
35-
elif "@SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY@" == "MultiThreadedDLL":
36-
config.swift_stdlib_msvc_runtime = 'MD'
37-
elif "@SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY@" == "MultiThreadedDebugDLL":
38-
config.swift_stdlib_msvc_runtime = 'MDd'
39-
else:
40-
assert(False)
41-
4230
config.swift_test_results_dir = \
4331
lit_config.params.get("swift_test_results_dir", "@SWIFT_TEST_RESULTS_DIR@")
32+
33+
config.coverage_mode = "@SWIFT_ANALYZE_CODE_COVERAGE@"
34+
config.lldb_build_root = "@LLDB_BUILD_DIR@"
35+
36+
# --- Darwin ---
4437
config.darwin_xcrun_toolchain = "@SWIFT_DARWIN_XCRUN_TOOLCHAIN@"
38+
39+
# --- android ---
4540
config.android_ndk_path = "@SWIFT_ANDROID_NDK_PATH@"
4641
config.android_ndk_gcc_version = "@SWIFT_ANDROID_NDK_GCC_VERSION@"
4742

48-
config.coverage_mode = "@SWIFT_ANALYZE_CODE_COVERAGE@"
49-
config.lldb_build_root = "@LLDB_BUILD_DIR@"
43+
# --- Windows ---
44+
msvc_runtime_flags = {
45+
'MultiThreaded': 'MT',
46+
'MultiThreadedDebug': 'MTd',
47+
'MultiThreadedDLL': 'MD',
48+
'MultiThreadedDebugDLL': 'MDd',
49+
}
50+
config.swift_stdlib_msvc_runtime = \
51+
msvc_runtime_flags["@SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY@"]
5052

5153
# Please remember to handle empty strings and/or unset variables correctly.
5254

branches/tensorflow-next/test/stdlib/Inputs/DictionaryKeyValueTypesObjC.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
#if _runtime(_ObjC)
3+
14
import Swift
25
import SwiftPrivate
36
import Darwin
@@ -1002,3 +1005,6 @@ func getBridgedNSArrayOfValueTypeCustomBridged(
10021005

10031006
return bridged
10041007
}
1008+
1009+
#endif
1010+

branches/tensorflow-next/test/stdlib/Inputs/NSSlowString/NSSlowString.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
#if __has_include(<Foundation/Foundation.h>)
3+
14
#import "NSSlowString.h"
25

36

@@ -41,3 +44,6 @@ - (void *) _fastCharacterContents {
4144
}
4245

4346
@end
47+
48+
#endif
49+

branches/tensorflow-next/test/stdlib/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
#if __has_include(<Foundation/Foundation.h>)
13
#include <Foundation/Foundation.h>
24

35
void slurpFastEnumerationOfArrayFromObjCImpl(id Array, id<NSFastEnumeration> FE,
@@ -16,4 +18,5 @@ void slurpFastEnumerationOfDictionaryFromObjCImpl(
1618
[KeyValuePairs addObject: NSD[Key]];
1719
}
1820
}
21+
#endif
1922

branches/tensorflow-next/utils/rth

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ class ResilienceTest(object):
7474
os.makedirs(self.before_dir)
7575

7676
def is_apple_platform(self):
77-
return any('-apple-' in arg for arg in self.target_build_swift)
77+
return self.triple.split('-')[1] == 'apple'
78+
79+
def is_windows_host(self):
80+
return self.triple.split('-')[2] == 'windows'
7881

7982
def compile_library(self):
8083
for config in self.config_dir_map:
@@ -172,21 +175,32 @@ class ResilienceTest(object):
172175
config1_lower + '_' + config2_lower)
173176
if self.is_apple_platform():
174177
rpath_origin = '@executable_path'
178+
elif self.is_windows_host():
179+
pass
175180
else:
181+
# assume it is an ELF host
176182
rpath_origin = '$ORIGIN'
177183

178184
compiler_flags = [
179185
'-L', self.config_dir_map[config2],
180186
'-l' + self.lib_name,
181187
os.path.join(self.config_dir_map[config2],
182188
'main.o'),
183-
'-Xlinker', '-rpath', '-Xlinker',
184-
os.path.join(rpath_origin,
185-
os.path.relpath(self.config_dir_map[config1],
186-
self.tmp_dir)),
187189
'-o', output_obj
188190
]
189191

192+
if self.is_windows_host():
193+
# Emulate RPATH by changing to the location as `PATH` is what
194+
# drives library searching on Windows
195+
os.chdir(self.config_dir_map[config1])
196+
else:
197+
compiler_flags.extend([
198+
'-Xlinker', '-rpath', '-Xlinker',
199+
os.path.join(rpath_origin,
200+
os.path.relpath(self.config_dir_map[config1],
201+
self.tmp_dir)),
202+
])
203+
190204
if self.is_apple_platform():
191205
compiler_flags += ['-Xlinker', '-bind_at_load']
192206

branches/tensorflow-next/validation-test/stdlib/ArrayNew.swift.gyb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// RUN: %empty-directory(%t)
22
//
33
// RUN: %gyb %s -o %t/main.swift
4-
// RUN: if [ %target-runtime == "objc" ]; then \
5-
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o; \
6-
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift %t/main.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Array -Xfrontend -disable-access-control -swift-version 4.2; \
7-
// RUN: else \
8-
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %t/main.swift -o %t/Array -Xfrontend -disable-access-control -swift-version 4.2; \
9-
// RUN: fi
4+
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o
5+
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift %t/main.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Array -Xfrontend -disable-access-control -swift-version 4.2
106
// RUN: %target-codesign %t/Array && %line-directive %t/main.swift -- %target-run %t/Array
117
// REQUIRES: executable_test
128

branches/tensorflow-next/validation-test/stdlib/Arrays.swift.gyb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// RUN: %empty-directory(%t)
22
//
33
// RUN: %gyb %s -o %t/main.swift
4-
// RUN: if [ %target-runtime == "objc" ]; then \
5-
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o; \
6-
// RUN: %line-directive %t/main.swift -- %target-build-swift %t/main.swift %S/Inputs/ArrayTypesAndHelpers.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Arrays -Xfrontend -disable-access-control; \
7-
// RUN: else \
8-
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/ArrayTypesAndHelpers.swift %t/main.swift -o %t/Arrays -Xfrontend -disable-access-control; \
9-
// RUN: fi
4+
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o
5+
// RUN: %line-directive %t/main.swift -- %target-build-swift %t/main.swift %S/Inputs/ArrayTypesAndHelpers.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Arrays -Xfrontend -disable-access-control
106
//
117
// RUN: %target-codesign %t/Arrays && %line-directive %t/main.swift -- %target-run %t/Arrays
128
// REQUIRES: executable_test

branches/tensorflow-next/validation-test/stdlib/Dictionary.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// RUN: %empty-directory(%t)
22
//
33
// RUN: %gyb %s -o %t/main.swift
4-
// RUN: if [ %target-runtime == "objc" ]; then \
5-
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o; \
6-
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift %t/main.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Dictionary -Xfrontend -disable-access-control; \
7-
// RUN: else \
8-
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %t/main.swift -o %t/Dictionary -Xfrontend -disable-access-control; \
9-
// RUN: fi
4+
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o
5+
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift %t/main.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Dictionary -Xfrontend -disable-access-control
106
//
117
// RUN: %target-codesign %t/Dictionary && %line-directive %t/main.swift -- %target-run %t/Dictionary
128
// REQUIRES: executable_test

branches/tensorflow-next/validation-test/stdlib/Set.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// RUN: %empty-directory(%t)
22
//
33
// RUN: %gyb %s -o %t/main.swift
4-
// RUN: if [ %target-runtime == "objc" ]; then \
5-
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o; \
6-
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift %t/main.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Set -Xfrontend -disable-access-control -swift-version 4.2; \
7-
// RUN: else \
8-
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %t/main.swift -o %t/Set -Xfrontend -disable-access-control -swift-version 4.2; \
9-
// RUN: fi
4+
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o
5+
// RUN: %line-directive %t/main.swift -- %target-build-swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift %t/main.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Set -Xfrontend -disable-access-control -swift-version 4.2
106
//
117
// RUN: %target-codesign %t/Set && %line-directive %t/main.swift -- %target-run %t/Set
128
// REQUIRES: executable_test

branches/tensorflow-next/validation-test/stdlib/String.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: if [ %target-runtime == "objc" ]; \
3-
// RUN: then \
4-
// RUN: %target-clang -fobjc-arc %S/Inputs/NSSlowString/NSSlowString.m -c -o %t/NSSlowString.o && \
5-
// RUN: %target-build-swift -I %S/Inputs/NSSlowString/ %t/NSSlowString.o %s -Xfrontend -disable-access-control -o %t/String; \
6-
// RUN: else \
7-
// RUN: %target-build-swift %s -Xfrontend -disable-access-control -o %t/String; \
8-
// RUN: fi
2+
// RUN: %target-clang -fobjc-arc %S/Inputs/NSSlowString/NSSlowString.m -c -o %t/NSSlowString.o
3+
// RUN: %target-build-swift -I %S/Inputs/NSSlowString/ %t/NSSlowString.o %s -Xfrontend -disable-access-control -o %t/String
94

105
// RUN: %target-codesign %t/String
116
// RUN: %target-run %t/String

branches/tensorflow-next/validation-test/stdlib/StringNormalization.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12+
1213
// RUN: %empty-directory(%t)
13-
// RUN: if [ %target-runtime == "objc" ]; \
14-
// RUN: then \
15-
// RUN: %target-clang -fobjc-arc %S/Inputs/NSSlowString/NSSlowString.m -c -o %t/NSSlowString.o && \
16-
// RUN: %target-build-swift -I %S/Inputs/NSSlowString/ %t/NSSlowString.o %s -o %t/a.out; \
17-
// RUN: else \
18-
// RUN: %target-build-swift %s -o %t/a.out; \
19-
// RUN: fi
14+
// RUN: %target-clang -fobjc-arc %S/Inputs/NSSlowString/NSSlowString.m -c -o %t/NSSlowString.o
15+
// RUN: %target-build-swift -I %S/Inputs/NSSlowString/ %t/NSSlowString.o %s -o %t/a.out
2016

2117
// RUN: %target-codesign %t/a.out
2218
// RUN: %target-run %t/a.out %S/Inputs/NormalizationTest.txt

branches/tensorflow-next/validation-test/stdlib/StringUTF8.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: if [ %target-runtime == "objc" ]; \
3-
// RUN: then \
4-
// RUN: %target-clang -fobjc-arc %S/Inputs/NSSlowString/NSSlowString.m -c -o %t/NSSlowString.o && \
5-
// RUN: %target-build-swift -I %S/Inputs/NSSlowString/ %t/NSSlowString.o %s -o %t/String; \
6-
// RUN: else \
7-
// RUN: %target-build-swift %s -o %t/String; \
8-
// RUN: fi
2+
// RUN: %target-clang -fobjc-arc %S/Inputs/NSSlowString/NSSlowString.m -c -o %t/NSSlowString.o
3+
// RUN: %target-build-swift -I %S/Inputs/NSSlowString/ %t/NSSlowString.o %s -o %t/String
94

105
// RUN: %target-codesign %t/String
116
// RUN: %target-run %t/String

0 commit comments

Comments
 (0)