Skip to content

Commit ce0ad87

Browse files
authored
Merge pull request #81813 from rjmansfield/fix_autodiff_device_tests
Add %target-codesign to executables and dylibs in newly added AutoDiff tests
2 parents 29d729b + 44ec621 commit ce0ad87

File tree

6 files changed

+18
-4
lines changed

6 files changed

+18
-4
lines changed

test/AutoDiff/validation-test/always_emit_into_client/multi_file.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// RUN: -emit-module -emit-module-path %t/MultiFileModule.swiftmodule -module-name MultiFileModule
88

99
// RUN: %target-build-swift -I%t %s -o %t/a.out %target-rpath(%t)
10+
// RUN: %target-codesign %t/a.out
1011
// RUN: %target-run %t/a.out
1112

1213
// RUN: %target-build-swift -I%t %s -emit-ir | %FileCheck %s

test/AutoDiff/validation-test/always_emit_into_client/multi_module.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
/// symbols because all the functions in the module are marked as @_alwaysEmitIntoClient.
66
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModule1)) %S/Inputs/MultiModule/file1.swift \
77
// RUN: -emit-module -emit-module-path %t/MultiModule1.swiftmodule -module-name MultiModule1
8+
// RUN: %target-codesign %t/%target-library-name(MultiModule1)
89
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModule2)) %S/Inputs/MultiModule/file2.swift \
910
// RUN: -emit-module -emit-module-path %t/MultiModule2.swiftmodule -module-name MultiModule2 -I%t %target-rpath(%t)
11+
// RUN: %target-codesign %t/%target-library-name(MultiModule2)
1012

1113
// RUN: %target-build-swift -I%t %s -o %t/a.out %target-rpath(%t)
12-
// RUN: %target-run %t/a.out
14+
// RUN: %target-codesign %t/a.out
15+
// RUN: %target-run %t/a.out %t/%target-library-name(MultiModule1) %t/%target-library-name(MultiModule2)
1316

1417
// RUN: %target-build-swift -I%t %s -emit-ir | %FileCheck %s
1518

test/AutoDiff/validation-test/always_emit_into_client/multi_module_protocol.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModuleProtocol1)) %S/Inputs/MultiModuleProtocol/file1.swift \
55
// RUN: -emit-module -emit-module-path %t/MultiModuleProtocol1.swiftmodule -module-name MultiModuleProtocol1
6+
// RUN: %target-codesign %t/%target-library-name(MultiModuleProtocol1)
67

78
/// Note: we build just a module without a library since it would not contain any exported
89
/// symbols because all the functions in the module are marked as @_alwaysEmitIntoClient.
@@ -11,12 +12,14 @@
1112

1213
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModuleProtocol3)) %S/Inputs/MultiModuleProtocol/file3.swift \
1314
// RUN: -emit-module -emit-module-path %t/MultiModuleProtocol3.swiftmodule -module-name MultiModuleProtocol3 -I%t -L%t -lMultiModuleProtocol1 %target-rpath(%t)
15+
// RUN: %target-codesign %t/%target-library-name(MultiModuleProtocol3)
1416

1517
/// Note: we enable forward-mode differentiation to automatically generate JVP for `foo`.
1618
/// It wraps `Protocol.sum` that has custom JVP defined in MultiModuleProtocol2, so we can test it.
1719
// RUN: %target-build-swift -Xfrontend -enable-experimental-forward-mode-differentiation \
1820
// RUN: -I%t -L%t %s -lMultiModuleProtocol1 -lMultiModuleProtocol3 -o %t/a.out %target-rpath(%t)
19-
// RUN: %target-run %t/a.out
21+
// RUN: %target-codesign %t/a.out
22+
// RUN: %target-run %t/a.out %t/%target-library-name(MultiModuleProtocol1) %t/%target-library-name(MultiModuleProtocol3)
2023

2124
// RUN: %target-build-swift -I%t %s -emit-ir | %FileCheck %s
2225

test/AutoDiff/validation-test/always_emit_into_client/multi_module_struct.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33

44
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModuleStruct1)) %S/Inputs/MultiModuleStruct/file1.swift \
55
// RUN: -emit-module -emit-module-path %t/MultiModuleStruct1.swiftmodule -module-name MultiModuleStruct1
6+
// RUN: %target-codesign %t/%target-library-name(MultiModuleStruct1)
67
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModuleStruct2)) %S/Inputs/MultiModuleStruct/file2.swift \
78
// RUN: -emit-module -emit-module-path %t/MultiModuleStruct2.swiftmodule -module-name MultiModuleStruct2 -I%t -L%t -lMultiModuleStruct1 %target-rpath(%t)
9+
// RUN: %target-codesign %t/%target-library-name(MultiModuleStruct2)
810

911
/// Note: we enable forward-mode differentiation to automatically generate JVP for `foo`.
1012
/// It wraps `Struct.sum` that has custom JVP defined in MultiModuleStruct2, so we can test it.
1113
// RUN: %target-build-swift -Xfrontend -enable-experimental-forward-mode-differentiation \
1214
// RUN: -I%t -L%t %s -lMultiModuleStruct1 -lMultiModuleStruct2 -o %t/a.out %target-rpath(%t)
13-
// RUN: %target-run %t/a.out
15+
// RUN: %target-codesign %t/a.out
16+
// RUN: %target-run %t/a.out %t/%target-library-name(MultiModuleStruct1) %t/%target-library-name(MultiModuleStruct2)
1417

1518
// RUN: %target-build-swift -I%t %s -emit-ir | %FileCheck %s
1619

test/AutoDiff/validation-test/always_emit_into_client/multi_module_struct_no_jvp.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33

44
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModuleStruct1)) %S/Inputs/MultiModuleStruct/file1.swift \
55
// RUN: -emit-module -emit-module-path %t/MultiModuleStruct1.swiftmodule -module-name MultiModuleStruct1
6+
// RUN: %target-codesign %t/%target-library-name(MultiModuleStruct1)
67
// RUN: %target-build-swift-dylib(%t/%target-library-name(MultiModuleStruct2NoJVP)) %S/Inputs/MultiModuleStruct/file2_no_jvp.swift \
78
// RUN: -emit-module -emit-module-path %t/MultiModuleStruct2NoJVP.swiftmodule -module-name MultiModuleStruct2NoJVP -I%t -L%t -lMultiModuleStruct1 %target-rpath(%t)
9+
// RUN: %target-codesign %t/%target-library-name(MultiModuleStruct2NoJVP)
810

911
/// Note: we enable forward-mode differentiation to automatically generate JVP for `foo`.
1012
/// It wraps `Struct.sum` that has custom JVP defined in MultiModuleStruct2, so we can test it.
1113
// RUN: %target-build-swift -Xfrontend -enable-experimental-forward-mode-differentiation \
1214
// RUN: -I%t -L%t %s -lMultiModuleStruct1 -lMultiModuleStruct2NoJVP -o %t/a.out %target-rpath(%t)
13-
// RUN: %target-run %t/a.out
15+
// RUN: %target-codesign %t/a.out
16+
// RUN: %target-run %t/a.out %t/%target-library-name(MultiModuleStruct1) %t/%target-library-name(MultiModuleStruct2NoJVP)
1417

1518
// RUN: %target-build-swift -I%t %s -emit-ir | %FileCheck %s
1619

test/AutoDiff/validation-test/always_emit_into_client/single_file.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// RUN: -emit-module-path %t/SingleFileModule.swiftmodule -module-name SingleFileModule
88

99
// RUN: %target-build-swift -I%t %s -o %t/a.out %target-rpath(%t)
10+
// RUN: %target-codesign %t/a.out
1011
// RUN: %target-run %t/a.out
1112

1213
// RUN: %target-build-swift -I%t %s -emit-ir | %FileCheck %s

0 commit comments

Comments
 (0)