Skip to content

Commit 28fea82

Browse files
authored
Add min-preludes to more slow tests (part 4) (#5682)
Adds min-preludes more tests which were seen as slow and their surrounding neighbours. This drops the file_test runtime on my machine from about 6s to about 4.5s. For a few files that are clearly only testing diagnostics, we drop the if-present semir ranges and the associated TODO.
1 parent ed82f7e commit 28fea82

File tree

142 files changed

+2000
-5293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+2000
-5293
lines changed

toolchain/check/testdata/choice/basic.carbon

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
//
5+
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/uint.carbon
6+
//
57
// AUTOUPDATE
68
// TIP: To test this file alone, run:
79
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/choice/basic.carbon
@@ -143,20 +145,20 @@ let never: Never = {};
143145
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
144146
// CHECK:STDOUT: %ImplicitAs.type.54b: type = facet_type <@ImplicitAs, @ImplicitAs(%u2)> [concrete]
145147
// CHECK:STDOUT: %Convert.type.f0e: type = fn_type @Convert.1, @ImplicitAs(%u2) [concrete]
146-
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
147-
// CHECK:STDOUT: %Convert.type.30e: type = fn_type @Convert.3, @impl.86e(%To.c80) [symbolic]
148+
// CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
149+
// CHECK:STDOUT: %Convert.type.30e: type = fn_type @Convert.2, @impl.86e(%To) [symbolic]
148150
// CHECK:STDOUT: %Convert.d1a: %Convert.type.30e = struct_value () [symbolic]
149-
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
150151
// CHECK:STDOUT: %ImplicitAs.impl_witness.801: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.bb8, @impl.86e(%int_2.ecc) [concrete]
151-
// CHECK:STDOUT: %Convert.type.70b: type = fn_type @Convert.3, @impl.86e(%int_2.ecc) [concrete]
152+
// CHECK:STDOUT: %Convert.type.70b: type = fn_type @Convert.2, @impl.86e(%int_2.ecc) [concrete]
152153
// CHECK:STDOUT: %Convert.474: %Convert.type.70b = struct_value () [concrete]
153-
// CHECK:STDOUT: %ImplicitAs.facet.7cf: %ImplicitAs.type.54b = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.801) [concrete]
154-
// CHECK:STDOUT: %.3e0: type = fn_type_with_self_type %Convert.type.f0e, %ImplicitAs.facet.7cf [concrete]
154+
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.54b = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.801) [concrete]
155+
// CHECK:STDOUT: %.3e0: type = fn_type_with_self_type %Convert.type.f0e, %ImplicitAs.facet [concrete]
155156
// CHECK:STDOUT: %Convert.bound.5bb: <bound method> = bound_method %int_0.5c6, %Convert.474 [concrete]
156-
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.474, @Convert.3(%int_2.ecc) [concrete]
157+
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.474, @Convert.2(%int_2.ecc) [concrete]
157158
// CHECK:STDOUT: %bound_method.d36: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
158159
// CHECK:STDOUT: %int_0.9fd: %u2 = int_value 0 [concrete]
159160
// CHECK:STDOUT: %Ordering.val.a29: %Ordering = struct_value (%int_0.9fd) [concrete]
161+
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
160162
// CHECK:STDOUT: %Convert.bound.0dd: <bound method> = bound_method %int_1.5b8, %Convert.474 [concrete]
161163
// CHECK:STDOUT: %bound_method.6bf: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
162164
// CHECK:STDOUT: %int_1.b2c: %u2 = int_value 1 [concrete]
@@ -174,7 +176,7 @@ let never: Never = {};
174176
// CHECK:STDOUT: }
175177
// CHECK:STDOUT:
176178
// CHECK:STDOUT: imports {
177-
// CHECK:STDOUT: %Core.import_ref.c3d: @impl.86e.%Convert.type (%Convert.type.30e) = import_ref Core//prelude/types/uint, loc20_40, loaded [symbolic = @impl.86e.%Convert (constants.%Convert.d1a)]
179+
// CHECK:STDOUT: %Core.import_ref.c3d: @impl.86e.%Convert.type (%Convert.type.30e) = import_ref Core//prelude/parts/uint, loc16_40, loaded [symbolic = @impl.86e.%Convert (constants.%Convert.d1a)]
178180
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.bb8 = impl_witness_table (%Core.import_ref.c3d), @impl.86e [concrete]
179181
// CHECK:STDOUT: }
180182
// CHECK:STDOUT:
@@ -209,7 +211,7 @@ let never: Never = {};
209211
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
210212
// CHECK:STDOUT: %impl.elem0.loc5: %.3e0 = impl_witness_access constants.%ImplicitAs.impl_witness.801, element0 [concrete = constants.%Convert.474]
211213
// CHECK:STDOUT: %bound_method.loc5_7.1: <bound method> = bound_method %int_0, %impl.elem0.loc5 [concrete = constants.%Convert.bound.5bb]
212-
// CHECK:STDOUT: %specific_fn.loc5: <specific function> = specific_function %impl.elem0.loc5, @Convert.3(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
214+
// CHECK:STDOUT: %specific_fn.loc5: <specific function> = specific_function %impl.elem0.loc5, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
213215
// CHECK:STDOUT: %bound_method.loc5_7.2: <bound method> = bound_method %int_0, %specific_fn.loc5 [concrete = constants.%bound_method.d36]
214216
// CHECK:STDOUT: %int.convert_checked.loc5: init %u2 = call %bound_method.loc5_7.2(%int_0) [concrete = constants.%int_0.9fd]
215217
// CHECK:STDOUT: %.loc5_7.1: %u2 = value_of_initializer %int.convert_checked.loc5 [concrete = constants.%int_0.9fd]
@@ -226,7 +228,7 @@ let never: Never = {};
226228
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
227229
// CHECK:STDOUT: %impl.elem0.loc6: %.3e0 = impl_witness_access constants.%ImplicitAs.impl_witness.801, element0 [concrete = constants.%Convert.474]
228230
// CHECK:STDOUT: %bound_method.loc6_13.1: <bound method> = bound_method %int_1, %impl.elem0.loc6 [concrete = constants.%Convert.bound.0dd]
229-
// CHECK:STDOUT: %specific_fn.loc6: <specific function> = specific_function %impl.elem0.loc6, @Convert.3(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
231+
// CHECK:STDOUT: %specific_fn.loc6: <specific function> = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
230232
// CHECK:STDOUT: %bound_method.loc6_13.2: <bound method> = bound_method %int_1, %specific_fn.loc6 [concrete = constants.%bound_method.6bf]
231233
// CHECK:STDOUT: %int.convert_checked.loc6: init %u2 = call %bound_method.loc6_13.2(%int_1) [concrete = constants.%int_1.b2c]
232234
// CHECK:STDOUT: %.loc6_13.1: %u2 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_1.b2c]
@@ -243,7 +245,7 @@ let never: Never = {};
243245
// CHECK:STDOUT: %int_2.loc7: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
244246
// CHECK:STDOUT: %impl.elem0.loc7: %.3e0 = impl_witness_access constants.%ImplicitAs.impl_witness.801, element0 [concrete = constants.%Convert.474]
245247
// CHECK:STDOUT: %bound_method.loc7_10.1: <bound method> = bound_method %int_2.loc7, %impl.elem0.loc7 [concrete = constants.%Convert.bound.122]
246-
// CHECK:STDOUT: %specific_fn.loc7: <specific function> = specific_function %impl.elem0.loc7, @Convert.3(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
248+
// CHECK:STDOUT: %specific_fn.loc7: <specific function> = specific_function %impl.elem0.loc7, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
247249
// CHECK:STDOUT: %bound_method.loc7_10.2: <bound method> = bound_method %int_2.loc7, %specific_fn.loc7 [concrete = constants.%bound_method.f7d]
248250
// CHECK:STDOUT: %int.convert_checked.loc7: init %u2 = call %bound_method.loc7_10.2(%int_2.loc7) [concrete = constants.%int_2.788]
249251
// CHECK:STDOUT: %.loc7_10.1: %u2 = value_of_initializer %int.convert_checked.loc7 [concrete = constants.%int_2.788]
@@ -260,7 +262,7 @@ let never: Never = {};
260262
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
261263
// CHECK:STDOUT: %impl.elem0.loc9: %.3e0 = impl_witness_access constants.%ImplicitAs.impl_witness.801, element0 [concrete = constants.%Convert.474]
262264
// CHECK:STDOUT: %bound_method.loc9_1.1: <bound method> = bound_method %int_3, %impl.elem0.loc9 [concrete = constants.%Convert.bound.a5c]
263-
// CHECK:STDOUT: %specific_fn.loc9: <specific function> = specific_function %impl.elem0.loc9, @Convert.3(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
265+
// CHECK:STDOUT: %specific_fn.loc9: <specific function> = specific_function %impl.elem0.loc9, @Convert.2(constants.%int_2.ecc) [concrete = constants.%Convert.specific_fn]
264266
// CHECK:STDOUT: %bound_method.loc9_1.2: <bound method> = bound_method %int_3, %specific_fn.loc9 [concrete = constants.%bound_method.c7e]
265267
// CHECK:STDOUT: %int.convert_checked.loc9: init %u2 = call %bound_method.loc9_1.2(%int_3) [concrete = constants.%int_3.975]
266268
// CHECK:STDOUT: %.loc9_1.1: %u2 = value_of_initializer %int.convert_checked.loc9 [concrete = constants.%int_3.975]

toolchain/check/testdata/choice/generic.carbon

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
//
5+
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/uint.carbon
6+
//
57
// AUTOUPDATE
68
// TIP: To test this file alone, run:
79
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/choice/generic.carbon
@@ -37,33 +39,33 @@ choice Always(T:! type) {
3739
// CHECK:STDOUT: %Always.decl: %Always.type = class_decl @Always [concrete = constants.%Always.generic] {
3840
// CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
3941
// CHECK:STDOUT: } {
40-
// CHECK:STDOUT: %T.loc12_15.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_15.2 (constants.%T)]
42+
// CHECK:STDOUT: %T.loc14_15.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_15.2 (constants.%T)]
4143
// CHECK:STDOUT: }
4244
// CHECK:STDOUT: }
4345
// CHECK:STDOUT:
44-
// CHECK:STDOUT: generic class @Always(%T.loc12_15.1: type) {
45-
// CHECK:STDOUT: %T.loc12_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_15.2 (constants.%T)]
46+
// CHECK:STDOUT: generic class @Always(%T.loc14_15.1: type) {
47+
// CHECK:STDOUT: %T.loc14_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_15.2 (constants.%T)]
4648
// CHECK:STDOUT:
4749
// CHECK:STDOUT: !definition:
48-
// CHECK:STDOUT: %Always: type = class_type @Always, @Always(%T.loc12_15.2) [symbolic = %Always (constants.%Always)]
50+
// CHECK:STDOUT: %Always: type = class_type @Always, @Always(%T.loc14_15.2) [symbolic = %Always (constants.%Always)]
4951
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Always [symbolic = %require_complete (constants.%require_complete)]
5052
// CHECK:STDOUT: %Always.val: @Always.%Always (%Always) = struct_value (constants.%empty_tuple) [symbolic = %Always.val (constants.%Always.val)]
5153
// CHECK:STDOUT:
5254
// CHECK:STDOUT: class {
5355
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.discriminant [concrete = constants.%complete_type]
54-
// CHECK:STDOUT: %.loc14_1.1: %empty_tuple.type = tuple_literal ()
56+
// CHECK:STDOUT: %.loc16_1.1: %empty_tuple.type = tuple_literal ()
5557
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
56-
// CHECK:STDOUT: %.loc14_1.2: %empty_tuple.type = converted %.loc14_1.1, %empty_tuple [concrete = constants.%empty_tuple]
57-
// CHECK:STDOUT: %.loc14_1.3: %struct_type.discriminant = struct_literal (%.loc14_1.2)
58-
// CHECK:STDOUT: %.loc14_1.4: ref @Always.%Always (%Always) = temporary_storage
59-
// CHECK:STDOUT: %.loc14_1.5: ref %empty_tuple.type = class_element_access %.loc14_1.4, element0
60-
// CHECK:STDOUT: %.loc14_1.6: init %empty_tuple.type = tuple_init () to %.loc14_1.5 [concrete = constants.%empty_tuple]
61-
// CHECK:STDOUT: %.loc14_1.7: init %empty_tuple.type = converted %.loc14_1.2, %.loc14_1.6 [concrete = constants.%empty_tuple]
62-
// CHECK:STDOUT: %.loc14_1.8: init @Always.%Always (%Always) = class_init (%.loc14_1.7), %.loc14_1.4 [symbolic = %Always.val (constants.%Always.val)]
63-
// CHECK:STDOUT: %.loc14_1.9: ref @Always.%Always (%Always) = temporary %.loc14_1.4, %.loc14_1.8
64-
// CHECK:STDOUT: %.loc14_1.10: ref @Always.%Always (%Always) = converted %.loc14_1.3, %.loc14_1.9
65-
// CHECK:STDOUT: %.loc14_1.11: @Always.%Always (%Always) = bind_value %.loc14_1.10
66-
// CHECK:STDOUT: %Sunny: @Always.%Always (%Always) = bind_name Sunny, %.loc14_1.11
58+
// CHECK:STDOUT: %.loc16_1.2: %empty_tuple.type = converted %.loc16_1.1, %empty_tuple [concrete = constants.%empty_tuple]
59+
// CHECK:STDOUT: %.loc16_1.3: %struct_type.discriminant = struct_literal (%.loc16_1.2)
60+
// CHECK:STDOUT: %.loc16_1.4: ref @Always.%Always (%Always) = temporary_storage
61+
// CHECK:STDOUT: %.loc16_1.5: ref %empty_tuple.type = class_element_access %.loc16_1.4, element0
62+
// CHECK:STDOUT: %.loc16_1.6: init %empty_tuple.type = tuple_init () to %.loc16_1.5 [concrete = constants.%empty_tuple]
63+
// CHECK:STDOUT: %.loc16_1.7: init %empty_tuple.type = converted %.loc16_1.2, %.loc16_1.6 [concrete = constants.%empty_tuple]
64+
// CHECK:STDOUT: %.loc16_1.8: init @Always.%Always (%Always) = class_init (%.loc16_1.7), %.loc16_1.4 [symbolic = %Always.val (constants.%Always.val)]
65+
// CHECK:STDOUT: %.loc16_1.9: ref @Always.%Always (%Always) = temporary %.loc16_1.4, %.loc16_1.8
66+
// CHECK:STDOUT: %.loc16_1.10: ref @Always.%Always (%Always) = converted %.loc16_1.3, %.loc16_1.9
67+
// CHECK:STDOUT: %.loc16_1.11: @Always.%Always (%Always) = bind_value %.loc16_1.10
68+
// CHECK:STDOUT: %Sunny: @Always.%Always (%Always) = bind_name Sunny, %.loc16_1.11
6769
// CHECK:STDOUT: complete_type_witness = %complete_type
6870
// CHECK:STDOUT:
6971
// CHECK:STDOUT: !members:
@@ -73,6 +75,6 @@ choice Always(T:! type) {
7375
// CHECK:STDOUT: }
7476
// CHECK:STDOUT:
7577
// CHECK:STDOUT: specific @Always(constants.%T) {
76-
// CHECK:STDOUT: %T.loc12_15.2 => constants.%T
78+
// CHECK:STDOUT: %T.loc14_15.2 => constants.%T
7779
// CHECK:STDOUT: }
7880
// CHECK:STDOUT:

toolchain/check/testdata/choice/params.carbon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
//
5+
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/uint.carbon
6+
//
57
// AUTOUPDATE
68
// TIP: To test this file alone, run:
79
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/choice/params.carbon

0 commit comments

Comments
 (0)