Skip to content

Commit 5aecece

Browse files
committed
Address review feedback.
- Use `IDENTIFIER_(Differentiation)` macro. - Add `differentiable_programming` lit support.
1 parent 35edb18 commit 5aecece

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

include/swift/AST/KnownIdentifiers.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ IDENTIFIER(decode)
5353
IDENTIFIER(decodeIfPresent)
5454
IDENTIFIER(Decoder)
5555
IDENTIFIER(decoder)
56-
IDENTIFIER_WITH_NAME(Differentiation, "_Differentiation")
56+
IDENTIFIER_(Differentiation)
5757
IDENTIFIER(dynamicallyCall)
5858
IDENTIFIER(dynamicMember)
5959
IDENTIFIER(Element)

test/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ normalize_boolean_spelling(SWIFT_AST_VERIFIER)
134134
normalize_boolean_spelling(SWIFT_ASAN_BUILD)
135135
normalize_boolean_spelling(SWIFT_BUILD_SYNTAXPARSERLIB)
136136
normalize_boolean_spelling(SWIFT_ENABLE_SOURCEKIT_TESTS)
137+
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
137138
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" SWIFT_OPTIMIZED)
138139

139140
set(profdata_merge_worker
@@ -305,6 +306,10 @@ _Block_release(void) { }\n")
305306

306307
list(APPEND LIT_ARGS "--xunit-xml-output=${SWIFT_TEST_RESULTS_DIR}/lit-tests.xml")
307308

309+
if(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
310+
list(APPEND LIT_ARGS "--param" "differentiable_programming")
311+
endif()
312+
308313
foreach(test_subset ${TEST_SUBSETS})
309314
set(directories)
310315
set(dependencies ${test_dependencies})

test/Differentiation/differentiable_protocol.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-typecheck-verify-swift
2+
// REQUIRES: differentiable_programming
23

34
import _Differentiation
45

test/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ swift_version = lit_config.params.get('swift-version',
345345
lit_config.note('Compiling with -swift-version ' + swift_version)
346346
config.swift_test_options = '-swift-version ' + swift_version
347347

348+
differentiable_programming = lit_config.params.get('differentiable_programming', None)
349+
if differentiable_programming is not None:
350+
config.available_features.add('differentiable_programming')
351+
348352
test_options = os.environ.get('SWIFT_TEST_OPTIONS')
349353
if test_options:
350354
config.swift_test_options += ' '

test/lit.site.cfg.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ else:
118118
if '@SWIFT_INCLUDE_TOOLS@' == 'TRUE':
119119
config.available_features.add('swift_tools_extra')
120120

121+
if "@SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING@" == "TRUE":
122+
config.available_features.add('differentiable_programming')
123+
121124
# Let the main config do the real work.
122125
if config.test_exec_root is None:
123126
config.test_exec_root = os.path.dirname(os.path.realpath(__file__))

0 commit comments

Comments
 (0)