Skip to content

Commit f70d2bb

Browse files
Add test cases for virtualized output types
Add unit-tests for already virtualized outputs
1 parent 2aaeb37 commit f70d2bb

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/Frontend/output_determinism_check.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -module-name test -emit-module -o %t/test.swiftmodule -primary-file %s -enable-swift-deterministic-check 2>&1 | %FileCheck %s --check-prefix=MODULE_OUTPUT
2+
// RUN: %target-swift-frontend -module-name test -emit-module -o %t/test.swiftmodule -primary-file %s -emit-module-doc-path %t/test.docc -enable-swift-deterministic-check 2>&1 | %FileCheck %s --check-prefix=MODULE_OUTPUT --check-prefix=DOCC_OUTPUT
33
// RUN: %target-swift-frontend -module-name test -emit-sib -o %t/test.sib -primary-file %s -enable-swift-deterministic-check 2>&1 | %FileCheck %s --check-prefix=SIB_OUTPUT
44

55
/// object files are "not" deterministic because the second run going to match the mod hash and skip code generation.
66
// RUN: not %target-swift-frontend -module-name test -c -o %t/test.o -primary-file %s -enable-swift-deterministic-check 2>&1 | %FileCheck %s --check-prefix=OBJECT_MISMATCH
77
/// object files should match when forcing object generation.
8-
// RUN: %target-swift-frontend -module-name test -c -o %t/test.o -primary-file %s -enable-swift-deterministic-check -always-compile-output-files 2>&1 | %FileCheck %s --check-prefix=OBJECT_OUTPUT
8+
// RUN: %target-swift-frontend -module-name test -emit-dependencies -c -o %t/test.o -primary-file %s -enable-swift-deterministic-check -always-compile-output-files 2>&1 | %FileCheck %s --check-prefix=OBJECT_OUTPUT --check-prefix=DEPS_OUTPUT
9+
10+
/// FIXME: Fine-grain dependencies graph is not deterministics.
11+
/// FAIL: %target-swift-frontend -module-name test -emit-reference-dependencies-path %t/test.swiftdeps -c -o %t/test.o -primary-file %s -enable-swift-deterministic-check -always-compile-output-files
912

1013
/// Explicit module build. Check building swiftmodule from interface file.
1114
// RUN: %target-swift-frontend -scan-dependencies -module-name test -o %t/test.json %s -enable-swift-deterministic-check 2>&1 | %FileCheck %s --check-prefix=DEPSCAN_OUTPUT
@@ -17,13 +20,21 @@
1720
/// Force swiftmodule generation.
1821
// RUN: %target-swift-frontend -compile-module-from-interface %t/test.swiftinterface -explicit-interface-module-build -o %t/test.swiftmodule -enable-swift-deterministic-check -always-compile-output-files 2>&1 | %FileCheck --check-prefix=MODULE_OUTPUT %s
1922

23+
// RUN: %target-swift-frontend -scan-dependencies -module-name test %s -o %t/test.deps.json -enable-swift-deterministic-check 2>&1 | %FileCheck %s --check-prefix=DEPS_JSON_OUTPUT
24+
25+
// RUN: %target-swift-frontend -emit-pcm -module-name UserClangModule -o %t/test.pcm %S/Inputs/dependencies/module.modulemap -enable-swift-deterministic-check 2>&1 | %FileCheck %s --check-prefix=PCM_OUTPUT
26+
27+
// DOCC_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.docc'
2028
// MODULE_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.swiftmodule'
2129
// SIB_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.sib'
30+
// DEPS_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.d'
2231
// OBJECT_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.o'
2332
// OBJECT_MISMATCH: error: output file '{{.*}}{{/|\\}}test.o' is missing from second compilation for deterministic check
2433
// DEPSCAN_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.json'
2534
// INTERFACE_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.swiftinterface'
2635
// MODULE_MISMATCH: error: output file '{{.*}}{{/|\\}}test.swiftmodule' is missing from second compilation for deterministic check
36+
// DEPS_JSON_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.deps.json'
37+
// PCM_OUTPUT: remark: produced matching output file '{{.*}}{{/|\\}}test.pcm'
2738

2839
public var x = 1
2940
public func test() {}

0 commit comments

Comments
 (0)