Skip to content

Commit 0291b36

Browse files
author
David Ungar
committed
off-by-default & fix tests
1 parent 2a79331 commit 0291b36

File tree

4 files changed

+70
-66
lines changed

4 files changed

+70
-66
lines changed

lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ Driver::buildCompilation(const ToolChain &TC,
954954

955955
const bool OnlyOneDependencyFile =
956956
ArgList->hasFlag(options::OPT_enable_only_one_dependency_file,
957-
options::OPT_disable_only_one_dependency_file, true);
957+
options::OPT_disable_only_one_dependency_file, false);
958958

959959
// relies on the new dependency graph
960960
const bool EnableFineGrainedDependencies =

test/Driver/advanced_output_file_map.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@
8282
// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "ld{{(.exe)?}}", inputs: ["./obj/advanced_output_file_map.o", "./obj/main.o", "./obj/lib.o", "./OutputFileMap.swiftmodule"], output: {image: "./advanced_output_file_map.out"}
8383
// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "dsymutil{{(\.exe)?}}", inputs: ["./advanced_output_file_map.out"], output: {dSYM: "./advanced_output_file_map.out.dSYM"}
8484

85-
// Defaulting to: -enable-only-one-dependency-file
85+
// Defaulting to: -disable-only-one-dependency-file
8686

87-
// RUN: %swiftc_driver -driver-print-output-file-map -target x86_64-apple-macosx10.9 -emit-executable -emit-module -serialize-diagnostics %/s %/S/Inputs/main.swift %/S/Inputs/lib.swift -g -o ./advanced_output_file_map.out -emit-module-path ./OutputFileMap.swiftmodule -module-name OutputFileMap -output-file-map %t/ofm.json 2>&1 | %FileCheck %/s -check-prefix=DUMPOFM-ENA
87+
// RUN: %swiftc_driver -driver-print-output-file-map -target x86_64-apple-macosx10.9 -emit-executable -emit-module -serialize-diagnostics %/s %/S/Inputs/main.swift %/S/Inputs/lib.swift -g -o ./advanced_output_file_map.out -emit-module-path ./OutputFileMap.swiftmodule -module-name OutputFileMap -output-file-map %t/ofm.json 2>&1 | %FileCheck %/s -check-prefix=DUMPOFM-DIS
8888

89-
// Should be two dummy files:
9089

9190
// RUN: %empty-directory(%t/d)
92-
// RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -emit-executable -emit-module -serialize-diagnostics -emit-dependencies %/s %/S/Inputs/main.swift %/S/Inputs/lib.swift -g -o ./advanced_output_file_map.out -emit-module-path ./OutputFileMap.swiftmodule -module-name OutputFileMap -output-file-map %t/ofm.json 2>&1 | tee /tmp/out | %FileCheck %/s -check-prefix=BINDINGS-ENA
91+
// RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -emit-executable -emit-module -serialize-diagnostics -emit-dependencies %/s %/S/Inputs/main.swift %/S/Inputs/lib.swift -g -o ./advanced_output_file_map.out -emit-module-path ./OutputFileMap.swiftmodule -module-name OutputFileMap -output-file-map %t/ofm.json 2>&1 | %FileCheck %/s -check-prefix=BINDINGS-DIS
92+
// Should be no dummy files:
9393
// RUN: test ! -e %t/d/advanced_output_file_map.d
94-
// RUN: test -e %t/d/main.d -a ! -s %t/d/main.d
95-
// RUN: test -e %t/d/lib.d -a ! -s %t/d/lib.d
94+
// RUN: test ! -e %t/d/main.d
95+
// RUN: test ! -e %t/d/lib.d
Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Without the only-one-dependency-file mode, all compile jobs are batchable, since the have the same output types.
1+
// When -enable-only-one-dependency-file (which is the default) the one compile job with the dependency output is unbatchable.
22

33
// RUN: %empty-directory(%t)
44
// RUN: touch %t/f_1_1.swift %t/f_1_2.swift %t/f_1_3.swift %t/f_1_4.swift %t/f_1_5.swift %t/f_1_6.swift %t/f_1_7.swift %t/f_1_8.swift %t/f_1_9.swift %t/f_1_10.swift
@@ -11,26 +11,66 @@
1111
// RUN: touch %t/f_8_1.swift %t/f_8_2.swift %t/f_8_3.swift %t/f_8_4.swift %t/f_8_5.swift %t/f_8_6.swift %t/f_8_7.swift %t/f_8_8.swift %t/f_8_9.swift %t/f_8_10.swift
1212
// RUN: touch %t/f_9_1.swift %t/f_9_2.swift %t/f_9_3.swift %t/f_9_4.swift %t/f_9_5.swift %t/f_9_6.swift %t/f_9_7.swift %t/f_9_8.swift %t/f_9_9.swift %t/f_9_10.swift
1313
// RUN: touch %t/f_10_1.swift %t/f_10_2.swift %t/f_10_3.swift %t/f_10_4.swift %t/f_10_5.swift %t/f_10_6.swift %t/f_10_7.swift %t/f_10_8.swift %t/f_10_9.swift %t/f_10_10.swift
14-
// RUN: %swiftc_driver -disable-only-one-dependency-file -driver-show-job-lifecycle -v -c -module-name foo -emit-module -serialize-diagnostics -emit-dependencies -j 1 -enable-batch-mode %t/f_*.swift >%t/out.txt 2>&1
15-
// RUN: %FileCheck %s <%t/out.txt
16-
// CHECK-NOT: unable to execute command
17-
// CHECK: Forming into 4 batches
18-
// CHECK: Forming batch job from 25 constituents
19-
// CHECK: Forming batch job from 25 constituents
20-
// CHECK: Forming batch job from 25 constituents
21-
// CHECK: Forming batch job from 25 constituents
22-
//
14+
// RUN: %swiftc_driver -disable-only-one-dependency-file -driver-show-job-lifecycle -v -c -module-name foo -emit-module -serialize-diagnostics -emit-dependencies -j 1 -enable-batch-mode %t/f_*.swift >%t/out.txt 2>&1
15+
16+
// RUN: %FileCheck %s -check-prefix=CHECK-DIS <%t/out.txt
17+
// CHECK-DIS-NOT: unable to execute command
18+
// CHECK-DIS: Forming into 4 batches
19+
// CHECK-DIS-DAG: Forming batch job from 25 constituents
20+
// CHECK-DIS-DAG: Forming batch job from 25 constituents
21+
// CHECK-DIS-DAG: Forming batch job from 25 constituents
22+
// CHECK-DIS-DAG: Forming batch job from 25 constituents
23+
24+
2325
// RUN: %swiftc_driver -disable-only-one-dependency-file -driver-show-job-lifecycle -driver-batch-size-limit 10 -v -c -module-name foo -emit-module -serialize-diagnostics -emit-dependencies -j 1 -enable-batch-mode %t/f_*.swift >%t/out2.txt 2>&1
24-
// RUN: %FileCheck %s <%t/out2.txt -check-prefix=EXPLICIT-ARG
25-
// EXPLICIT-ARG-NOT: unable to execute command
26-
// EXPLICIT-ARG: Forming into 10 batches
27-
// EXPLICIT-ARG: Forming batch job from 10 constituents
28-
// EXPLICIT-ARG: Forming batch job from 10 constituents
29-
// EXPLICIT-ARG: Forming batch job from 10 constituents
30-
// EXPLICIT-ARG: Forming batch job from 10 constituents
31-
// EXPLICIT-ARG: Forming batch job from 10 constituents
32-
// EXPLICIT-ARG: Forming batch job from 10 constituents
33-
// EXPLICIT-ARG: Forming batch job from 10 constituents
34-
// EXPLICIT-ARG: Forming batch job from 10 constituents
35-
// EXPLICIT-ARG: Forming batch job from 10 constituents
36-
// EXPLICIT-ARG: Forming batch job from 10 constituents
26+
// RUN: %FileCheck %s <%t/out2.txt -check-prefix=EXPLICIT-ARG-DIS
27+
// EXPLICIT-ARG-DIS-NOT: unable to execute command
28+
// EXPLICIT-ARG-DIS: Forming into 10 batches
29+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
30+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
31+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
32+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
33+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
34+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
35+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
36+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
37+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
38+
// EXPLICIT-ARG-DIS-DAG: Forming batch job from 10 constituents
39+
40+
41+
// When -enable-only-one-dependency-file (which is the default) the one compile job with the dependency output is unbatchable.
42+
43+
// RUN: %empty-directory(%t)
44+
// RUN: touch %t/f_1_1.swift %t/f_1_2.swift %t/f_1_3.swift %t/f_1_4.swift %t/f_1_5.swift %t/f_1_6.swift %t/f_1_7.swift %t/f_1_8.swift %t/f_1_9.swift %t/f_1_10.swift
45+
// RUN: touch %t/f_2_1.swift %t/f_2_2.swift %t/f_2_3.swift %t/f_2_4.swift %t/f_2_5.swift %t/f_2_6.swift %t/f_2_7.swift %t/f_2_8.swift %t/f_2_9.swift %t/f_2_10.swift
46+
// RUN: touch %t/f_3_1.swift %t/f_3_2.swift %t/f_3_3.swift %t/f_3_4.swift %t/f_3_5.swift %t/f_3_6.swift %t/f_3_7.swift %t/f_3_8.swift %t/f_3_9.swift %t/f_3_10.swift
47+
// RUN: touch %t/f_4_1.swift %t/f_4_2.swift %t/f_4_3.swift %t/f_4_4.swift %t/f_4_5.swift %t/f_4_6.swift %t/f_4_7.swift %t/f_4_8.swift %t/f_4_9.swift %t/f_4_10.swift
48+
// RUN: touch %t/f_5_1.swift %t/f_5_2.swift %t/f_5_3.swift %t/f_5_4.swift %t/f_5_5.swift %t/f_5_6.swift %t/f_5_7.swift %t/f_5_8.swift %t/f_5_9.swift %t/f_5_10.swift
49+
// RUN: touch %t/f_6_1.swift %t/f_6_2.swift %t/f_6_3.swift %t/f_6_4.swift %t/f_6_5.swift %t/f_6_6.swift %t/f_6_7.swift %t/f_6_8.swift %t/f_6_9.swift %t/f_6_10.swift
50+
// RUN: touch %t/f_7_1.swift %t/f_7_2.swift %t/f_7_3.swift %t/f_7_4.swift %t/f_7_5.swift %t/f_7_6.swift %t/f_7_7.swift %t/f_7_8.swift %t/f_7_9.swift %t/f_7_10.swift
51+
// RUN: touch %t/f_8_1.swift %t/f_8_2.swift %t/f_8_3.swift %t/f_8_4.swift %t/f_8_5.swift %t/f_8_6.swift %t/f_8_7.swift %t/f_8_8.swift %t/f_8_9.swift %t/f_8_10.swift
52+
// RUN: touch %t/f_9_1.swift %t/f_9_2.swift %t/f_9_3.swift %t/f_9_4.swift %t/f_9_5.swift %t/f_9_6.swift %t/f_9_7.swift %t/f_9_8.swift %t/f_9_9.swift %t/f_9_10.swift
53+
// RUN: touch %t/f_10_1.swift %t/f_10_2.swift %t/f_10_3.swift %t/f_10_4.swift %t/f_10_5.swift %t/f_10_6.swift %t/f_10_7.swift %t/f_10_8.swift %t/f_10_9.swift %t/f_10_10.swift
54+
// RUN: %swiftc_driver -enable-only-one-dependency-file -driver-show-job-lifecycle -v -c -module-name foo -emit-module -serialize-diagnostics -emit-dependencies -j 1 -enable-batch-mode %t/f_*.swift >%t/out.txt 2>&1
55+
// RUN: %FileCheck %s -check-prefix=CHECK-ENA <%t/out.txt
56+
// CHECK-ENA-NOT: unable to execute command
57+
// CHECK-ENA: Forming into 4 batches
58+
// CHECK-ENA-DAG: Forming batch job from 25 constituents
59+
// CHECK-ENA-DAG: Forming batch job from 25 constituents
60+
// CHECK-ENA-DAG: Forming batch job from 25 constituents
61+
// CHECK-ENA-DAG: Forming batch job from 24 constituents
62+
//
63+
// RUN: %swiftc_driver -enable-only-one-dependency-file -driver-show-job-lifecycle -driver-batch-size-limit 10 -v -c -module-name foo -emit-module -serialize-diagnostics -emit-dependencies -j 1 -enable-batch-mode %t/f_*.swift >%t/out2.txt 2>&1
64+
// RUN: %FileCheck %s <%t/out2.txt -check-prefix=EXPLICIT-ARG-ENA
65+
// EXPLICIT-ARG-ENA-NOT: unable to execute command
66+
// EXPLICIT-ARG-ENA: Forming into 10 batches
67+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
68+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
69+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
70+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
71+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
72+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
73+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
74+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
75+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 10 constituents
76+
// EXPLICIT-ARG-ENA-DAG: Forming batch job from 9 constituents

validation-test/Driver/batch_mode_size_limit_only_one_dependency-file.swift

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

0 commit comments

Comments
 (0)