Skip to content

Commit d0a4850

Browse files
jonmeowdanakj
andauthored
Flip the dump-sem-ir-ranges default in file_test (#5587)
This doesn't remove no-longer-needed flags; I'll do that in a separate PR after this is merged. --------- Co-authored-by: Dana Jansens <[email protected]>
1 parent 1899a6b commit d0a4850

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges.carbon

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
//
5-
// The default behavior should be `--dump-sem-ir-ranges=if-present`.
5+
// The default behavior should be `--dump-sem-ir-ranges=if-present`, although
6+
// tests set it to `only`. This explicitly tests the default of the toolchain,
7+
// not of file_test.
8+
// ARGS: compile --phase=check --no-prelude-import --dump-sem-ir %s
69
//
710
// AUTOUPDATE
811
// TIP: To test this file alone, run:

toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_only.carbon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
//
5-
// EXTRA-ARGS: --dump-sem-ir-ranges=only
5+
// This tests `--dump-sem-ir-range=only` behavior, which is set implicitly by
6+
// file_test.
67
//
78
// AUTOUPDATE
89
// TIP: To test this file alone, run:

toolchain/check/testdata/packages/implicit_imports_prelude.carbon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
//
55
// This is just checking an implicit import behavior with the prelude present.
66
//
7+
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
8+
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
9+
//
710
// AUTOUPDATE
811
// TIP: To test this file alone, run:
912
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/implicit_imports_prelude.carbon

toolchain/testing/file_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ auto ToolchainFileTest::GetDefaultArgs() const
192192
} else if (component_ == "parse") {
193193
args.push_back("--dump-parse-tree");
194194
} else if (component_ == "check") {
195-
args.push_back("--dump-sem-ir");
195+
args.insert(args.end(), {"--dump-sem-ir", "--dump-sem-ir-ranges=only"});
196196
} else if (component_ == "lower") {
197197
args.insert(args.end(), {"--dump-llvm-ir", "--target=x86_64-linux-gnu"});
198198
} else {

0 commit comments

Comments
 (0)