diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2096f763383..48841cf409d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,11 +57,11 @@ repos: entry: scripts/run_buildifier.py language: python files: '^(.*/)?(BUILD\.bazel|BUILD|WORKSPACE)$|\.BUILD$|\.bzl$' - - id: executable-semantics-format-grammar - name: Format the executable_semantics grammar file - entry: executable_semantics/syntax/format_grammar.py + - id: explorer-format-grammar + name: Format the explorer grammar file + entry: explorer/syntax/format_grammar.py language: python - files: ^executable_semantics/syntax/(lexer.lpp|parser.ypp)$ + files: ^explorer/syntax/(lexer.lpp|parser.ypp)$ pass_filenames: false additional_dependencies: ['clang-format==13.0.1'] - id: clang-format diff --git a/README.md b/README.md index a05a7f10a6a4..43c5a62813e6 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ Learn more about Carbon's design: - [Project goals](docs/project/goals.md) - [Language overview](docs/design/) -- [Executable semantics](executable_semantics/) +- [Explorer](explorer/) ## Join us diff --git a/bazel/check_deps/BUILD b/bazel/check_deps/BUILD index 860155ab1c42..19bd01c8d36f 100644 --- a/bazel/check_deps/BUILD +++ b/bazel/check_deps/BUILD @@ -13,7 +13,7 @@ load("@mypy_integration//:mypy.bzl", "mypy_test") filegroup( name = "non_test_cc_rules", data = [ - "//executable_semantics", + "//explorer", "//installers/local:carbon", "//migrate_cpp/cpp_refactoring", "//toolchain/diagnostics:null_diagnostics", diff --git a/docs/project/roadmap.md b/docs/project/roadmap.md index 6b2053e0d4af..bebe5dcd7d42 100644 --- a/docs/project/roadmap.md +++ b/docs/project/roadmap.md @@ -45,8 +45,8 @@ and it should be possible to write non-trivial Carbon programs. An initial rough framework for the core standard library functionality should be provided, as necessary to support the core language components. A largely complete implementation of the core language design should be available in -executable semantics. The toolchain should be able to parse the core language -design, with some support for name lookup and type-checking. +explorer. The toolchain should be able to parse the core language design, with +some support for name lookup and type-checking. We should have begun writing non-trivial portions of the standard library, such as common higher-level data structures and algorithms. @@ -120,7 +120,7 @@ overarching value proposition. We should have a clear understanding of the syntax and semantics used by these example ports. We should be able to demonstrate that self-contained portions of -the ported code work correctly using the executable semantics implementation. +the ported code work correctly using the explorer implementation. ### Demo implementation of core features with working examples @@ -169,7 +169,7 @@ This should include both a human readable rendering of the formal semantics as well as an execution environment to run test cases through those semantics. The implementation should cover enough of the core language that example code, such as the above ports of woff2 and RE2 and the Carbon standard library, can be -verified with the executable semantics implementation. +verified with the explorer implementation. ## Beyond 2022 diff --git a/executable_semantics/testdata/basic_syntax/fail_assign_to_function.carbon b/executable_semantics/testdata/basic_syntax/fail_assign_to_function.carbon deleted file mode 100644 index 6970cb36ff85..000000000000 --- a/executable_semantics/testdata/basic_syntax/fail_assign_to_function.carbon +++ /dev/null @@ -1,20 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/basic_syntax/fail_assign_to_function.carbon:18: Cannot assign to rvalue 'F' - -package ExecutableSemanticsTest api; - -fn F() {} -fn G() {} - -fn Main() -> i32 { - F = G; - return 0; -} diff --git a/executable_semantics/testdata/basic_syntax/fail_assign_to_rval.carbon b/executable_semantics/testdata/basic_syntax/fail_assign_to_rval.carbon deleted file mode 100644 index 2d43c8248f6f..000000000000 --- a/executable_semantics/testdata/basic_syntax/fail_assign_to_rval.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/basic_syntax/fail_assign_to_rval.carbon:15: Cannot assign to rvalue '1' - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - 1 = 0; - return 0; -} diff --git a/executable_semantics/testdata/basic_syntax/fail_invalid_char.carbon b/executable_semantics/testdata/basic_syntax/fail_invalid_char.carbon deleted file mode 100644 index cda65912dd04..000000000000 --- a/executable_semantics/testdata/basic_syntax/fail_invalid_char.carbon +++ /dev/null @@ -1,12 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/basic_syntax/fail_invalid_char.carbon:12: invalid character '\xEF' in source file. - -� diff --git a/executable_semantics/testdata/basic_syntax/fail_missing_var.carbon b/executable_semantics/testdata/basic_syntax/fail_missing_var.carbon deleted file mode 100644 index 885644a2afa5..000000000000 --- a/executable_semantics/testdata/basic_syntax/fail_missing_var.carbon +++ /dev/null @@ -1,18 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/basic_syntax/fail_missing_var.carbon:16: syntax error, unexpected COLON, expecting EQUAL or SEMICOLON - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - // error - x : i32; - return 1; -} diff --git a/executable_semantics/testdata/basic_syntax/fail_nested_binding.carbon b/executable_semantics/testdata/basic_syntax/fail_nested_binding.carbon deleted file mode 100644 index 3510f004993c..000000000000 --- a/executable_semantics/testdata/basic_syntax/fail_nested_binding.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/basic_syntax/fail_nested_binding.carbon:15: The type of a binding pattern cannot contain bindings. - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - var x: (T: Type) = 1; - return 1; -} diff --git a/executable_semantics/testdata/function/auto_return/fail_no_return.carbon b/executable_semantics/testdata/function/auto_return/fail_no_return.carbon deleted file mode 100644 index 0776f564d584..000000000000 --- a/executable_semantics/testdata/function/auto_return/fail_no_return.carbon +++ /dev/null @@ -1,19 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/auto_return/fail_no_return.carbon:15: control-flow reaches end of function that provides a `->` return type without reaching a return statement - -package ExecutableSemanticsTest api; - -fn NoReturn() -> auto { -} - -fn Main() { - NoReturn(); -} diff --git a/executable_semantics/testdata/function/fail_non_exhaustive_match.carbon b/executable_semantics/testdata/function/fail_non_exhaustive_match.carbon deleted file mode 100644 index f8a57361abf3..000000000000 --- a/executable_semantics/testdata/function/fail_non_exhaustive_match.carbon +++ /dev/null @@ -1,18 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/fail_non_exhaustive_match.carbon:18: non-exhaustive match may allow control-flow to reach the end of a function that provides a `->` return type - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - match (0) { - case 1 => return 0; - } -} diff --git a/executable_semantics/testdata/impl/fail_impl_as_not_constraint.carbon b/executable_semantics/testdata/impl/fail_impl_as_not_constraint.carbon deleted file mode 100644 index ed5b48f7cd6c..000000000000 --- a/executable_semantics/testdata/impl/fail_impl_as_not_constraint.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/impl/fail_impl_as_not_constraint.carbon:14: expected constraint after `as`, found value of type i32 - -package ExecutableSemanticsTest api; - -external impl i32 as i32 {} - -fn Main() -> i32 { -} diff --git a/executable_semantics/testdata/import/fail_order.carbon b/executable_semantics/testdata/import/fail_order.carbon deleted file mode 100644 index 949b45961c68..000000000000 --- a/executable_semantics/testdata/import/fail_order.carbon +++ /dev/null @@ -1,18 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/import/fail_order.carbon:18: syntax error, unexpected IMPORT, expecting END_OF_FILE - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - return 0; -} - -import ExecutableSemanticsTest library "Nonexistent"; diff --git a/executable_semantics/testdata/let/fail_global_assign.carbon b/executable_semantics/testdata/let/fail_global_assign.carbon deleted file mode 100644 index 99735022719c..000000000000 --- a/executable_semantics/testdata/let/fail_global_assign.carbon +++ /dev/null @@ -1,19 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_global_assign.carbon:17: Cannot assign to rvalue 'x' - -package ExecutableSemanticsTest api; - -let x: i32 = 10; - -fn Main() -> i32 { - x = 0; - return 0; -} diff --git a/executable_semantics/testdata/let/fail_local_assign.carbon b/executable_semantics/testdata/let/fail_local_assign.carbon deleted file mode 100644 index 61df566919ed..000000000000 --- a/executable_semantics/testdata/let/fail_local_assign.carbon +++ /dev/null @@ -1,18 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_local_assign.carbon:16: Cannot assign to rvalue 'x' - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - let x: auto = 10; - x = 0; - return 0; -} diff --git a/executable_semantics/testdata/name_lookup/fail_block_duplicate.carbon b/executable_semantics/testdata/name_lookup/fail_block_duplicate.carbon deleted file mode 100644 index 71c25fb1250a..000000000000 --- a/executable_semantics/testdata/name_lookup/fail_block_duplicate.carbon +++ /dev/null @@ -1,18 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/name_lookup/fail_block_duplicate.carbon:16: Duplicate name `x` also found at {{.*}}/executable_semantics/testdata/name_lookup/fail_block_duplicate.carbon:15 - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - var x: i32 = 0; - var x: i32 = 0; - return 0; -} diff --git a/executable_semantics/testdata/name_lookup/fail_choice_duplicate.carbon b/executable_semantics/testdata/name_lookup/fail_choice_duplicate.carbon deleted file mode 100644 index 94eabbae6836..000000000000 --- a/executable_semantics/testdata/name_lookup/fail_choice_duplicate.carbon +++ /dev/null @@ -1,21 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/name_lookup/fail_choice_duplicate.carbon:16: Duplicate name `None` in choice type - -package ExecutableSemanticsTest api; - -choice Ints { - None, - None, -} - -fn Main() -> i32 { - return 0; -} diff --git a/executable_semantics/testdata/name_lookup/fail_class_duplicate.carbon b/executable_semantics/testdata/name_lookup/fail_class_duplicate.carbon deleted file mode 100644 index ea09227ce354..000000000000 --- a/executable_semantics/testdata/name_lookup/fail_class_duplicate.carbon +++ /dev/null @@ -1,21 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/name_lookup/fail_class_duplicate.carbon:16: Duplicate name `x` also found at {{.*}}/executable_semantics/testdata/name_lookup/fail_class_duplicate.carbon:15 - -package ExecutableSemanticsTest api; - -class Foo { - var x: i32; - var x: i32; -} - -fn Main() -> i32 { - return 0; -} diff --git a/executable_semantics/testdata/name_lookup/fail_global_duplicate.carbon b/executable_semantics/testdata/name_lookup/fail_global_duplicate.carbon deleted file mode 100644 index 7e81a6f8d3fa..000000000000 --- a/executable_semantics/testdata/name_lookup/fail_global_duplicate.carbon +++ /dev/null @@ -1,19 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/name_lookup/fail_global_duplicate.carbon:15: Duplicate name `x` also found at {{.*}}/executable_semantics/testdata/name_lookup/fail_global_duplicate.carbon:14 - -package ExecutableSemanticsTest api; - -var x: i32 = 0; -var x: i32 = 0; - -fn Main() -> i32 { - return 0; -} diff --git a/executable_semantics/testdata/name_lookup/fail_match_duplicate.carbon b/executable_semantics/testdata/name_lookup/fail_match_duplicate.carbon deleted file mode 100644 index eec8968d565a..000000000000 --- a/executable_semantics/testdata/name_lookup/fail_match_duplicate.carbon +++ /dev/null @@ -1,20 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/name_lookup/fail_match_duplicate.carbon:17: Duplicate name `x` also found at {{.*}}/executable_semantics/testdata/name_lookup/fail_match_duplicate.carbon:16 - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - match (0) { - case x: i32 => - var x: i32 = 0; - } - return 0; -} diff --git a/executable_semantics/testdata/package/fail_missing.carbon b/executable_semantics/testdata/package/fail_missing.carbon deleted file mode 100644 index a68ac0bbfc04..000000000000 --- a/executable_semantics/testdata/package/fail_missing.carbon +++ /dev/null @@ -1,14 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/package/fail_missing.carbon:12: syntax error, unexpected FN, expecting PACKAGE - -fn Main() -> i32 { - return 0; -} diff --git a/executable_semantics/testdata/return/fail_explicit_with_no_return.carbon b/executable_semantics/testdata/return/fail_explicit_with_no_return.carbon deleted file mode 100644 index 69737eb2543d..000000000000 --- a/executable_semantics/testdata/return/fail_explicit_with_no_return.carbon +++ /dev/null @@ -1,20 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/return/fail_explicit_with_no_return.carbon:15: control-flow reaches end of function that provides a `->` return type without reaching a return statement - -package ExecutableSemanticsTest api; - -fn F() -> () { -} - -fn Main() -> i32 { - F(); - return 0; -} diff --git a/executable_semantics/testdata/return/fail_implicit_with_explicit_return.carbon b/executable_semantics/testdata/return/fail_implicit_with_explicit_return.carbon deleted file mode 100644 index b3910600128d..000000000000 --- a/executable_semantics/testdata/return/fail_implicit_with_explicit_return.carbon +++ /dev/null @@ -1,21 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/return/fail_implicit_with_explicit_return.carbon:15: return (); should not provide a return value, to match the function's signature. - -package ExecutableSemanticsTest api; - -fn F() { - return (); -} - -fn Main() -> i32 { - F(); - return 0; -} diff --git a/executable_semantics/testdata/string/fail_hex_lower.carbon b/executable_semantics/testdata/string/fail_hex_lower.carbon deleted file mode 100644 index e0505cf261dd..000000000000 --- a/executable_semantics/testdata/string/fail_hex_lower.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/string/fail_hex_lower.carbon:15: Invalid escaping in string: "str\xaa" - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - Print("str\xaa"); - return 0; -} diff --git a/executable_semantics/testdata/string/fail_hex_truncated.carbon b/executable_semantics/testdata/string/fail_hex_truncated.carbon deleted file mode 100644 index e910a39e919b..000000000000 --- a/executable_semantics/testdata/string/fail_hex_truncated.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/string/fail_hex_truncated.carbon:15: Invalid escaping in string: "str\x" - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - Print("str\x"); - return 0; -} diff --git a/executable_semantics/testdata/string/fail_invalid_escape.carbon b/executable_semantics/testdata/string/fail_invalid_escape.carbon deleted file mode 100644 index 8c67a7207ec2..000000000000 --- a/executable_semantics/testdata/string/fail_invalid_escape.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/string/fail_invalid_escape.carbon:15: Invalid escaping in string: "str\e" - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - Print("str\e"); - return 0; -} diff --git a/executable_semantics/testdata/string/fail_newline.carbon b/executable_semantics/testdata/string/fail_newline.carbon deleted file mode 100644 index bd6319adb792..000000000000 --- a/executable_semantics/testdata/string/fail_newline.carbon +++ /dev/null @@ -1,18 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/string/fail_newline.carbon:15: invalid character '\x22' in source file. - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - Print("new -line"); - return 0; -} diff --git a/executable_semantics/testdata/string/fail_octal.carbon b/executable_semantics/testdata/string/fail_octal.carbon deleted file mode 100644 index a059dce11467..000000000000 --- a/executable_semantics/testdata/string/fail_octal.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/string/fail_octal.carbon:15: Invalid escaping in string: "str\01" - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - Print("str\01"); - return 0; -} diff --git a/executable_semantics/testdata/string/fail_tab.carbon b/executable_semantics/testdata/string/fail_tab.carbon deleted file mode 100644 index 96e80a575fe7..000000000000 --- a/executable_semantics/testdata/string/fail_tab.carbon +++ /dev/null @@ -1,17 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ -// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/string/fail_tab.carbon:15: Invalid escaping in string: "new line" - -package ExecutableSemanticsTest api; - -fn Main() -> i32 { - Print("new line"); - return 0; -} diff --git a/executable_semantics/BUILD b/explorer/BUILD similarity index 77% rename from executable_semantics/BUILD rename to explorer/BUILD index 6bde92b321a6..5a64f3dc97d6 100644 --- a/executable_semantics/BUILD +++ b/explorer/BUILD @@ -6,7 +6,7 @@ load("@mypy_integration//:mypy.bzl", "mypy_test") package(default_visibility = [ "//bazel/check_deps:__pkg__", - "//executable_semantics:__subpackages__", + "//explorer:__subpackages__", "//installers:__subpackages__", ]) @@ -21,17 +21,17 @@ cc_library( hdrs = ["main.h"], deps = [ "//common:error", - "//executable_semantics/common:arena", - "//executable_semantics/common:nonnull", - "//executable_semantics/interpreter:exec_program", - "//executable_semantics/syntax", - "//executable_semantics/syntax:prelude", + "//explorer/common:arena", + "//explorer/common:nonnull", + "//explorer/interpreter:exec_program", + "//explorer/syntax", + "//explorer/syntax:prelude", "@llvm-project//llvm:Support", ], ) cc_binary( - name = "executable_semantics", + name = "explorer", srcs = ["main_bin.cpp"], deps = [ ":main", diff --git a/executable_semantics/README.md b/explorer/README.md similarity index 67% rename from executable_semantics/README.md rename to explorer/README.md index 38826bba8def..86759da8cf72 100644 --- a/executable_semantics/README.md +++ b/explorer/README.md @@ -1,4 +1,4 @@ -# Executable Semantics +# Explorer -`executable_semantics` is an implementation of Carbon whose primary purpose is -to act as a clear specification of the language. As an extension of that goal, -it can also be used as a platform for prototyping and validating changes to the -language. Consequently, it prioritizes straightforward, readable code over -performance, diagnostic quality, and other conventional implementation -priorities. In other words, its intended audience is people working on the -design of Carbon, and it is not intended for real-world Carbon programming on -any scale. See the [`toolchain`](/toolchain/) directory for a separate -implementation that's focused on the needs of Carbon users. +`explorer` is an implementation of Carbon whose primary purpose is to act as a +clear specification of the language. As an extension of that goal, it can also +be used as a platform for prototyping and validating changes to the language. +Consequently, it prioritizes straightforward, readable code over performance, +diagnostic quality, and other conventional implementation priorities. In other +words, its intended audience is people working on the design of Carbon, and it +is not intended for real-world Carbon programming on any scale. See the +[`toolchain`](/toolchain/) directory for a separate implementation that's +focused on the needs of Carbon users. ## Overview -`executable_semantics` represents Carbon code using an abstract syntax tree -(AST), which is defined in the [`ast`](ast/) directory. The [`syntax`](syntax/) -directory contains lexer and parser, which define how the AST is generated from -Carbon code. The [`interpreter`](interpreter/) directory contains the remainder -of the implementation. +`explorer` represents Carbon code using an abstract syntax tree (AST), which is +defined in the [`ast`](ast/) directory. The [`syntax`](syntax/) directory +contains lexer and parser, which define how the AST is generated from Carbon +code. The [`interpreter`](interpreter/) directory contains the remainder of the +implementation. -`executable_semantics` is an interpreter rather than a compiler, although it -attempts to separate compile time from run time, since that separation is an -important constraint on Carbon's design. +`explorer` is an interpreter rather than a compiler, although it attempts to +separate compile time from run time, since that separation is an important +constraint on Carbon's design. ## Programming conventions -The class hierarchies in `executable_semantics` are built to support +The class hierarchies in `explorer` are built to support [LLVM-style RTTI](https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html), and define a `kind` accessor that returns an enum identifying the concrete type. -`executable_semantics` typically relies less on virtual dispatch, and more on -using `kind` as the key of a `switch` and then down-casting in the individual -cases. As a result, adding a new derived class to a hierarchy requires updating -existing code to handle it. It is generally better to avoid defining `default` -cases for RTTI switches, so that the compiler can help ensure the code is -updated when a new type is added. +`explorer` typically relies less on virtual dispatch, and more on using `kind` +as the key of a `switch` and then down-casting in the individual cases. As a +result, adding a new derived class to a hierarchy requires updating existing +code to handle it. It is generally better to avoid defining `default` cases for +RTTI switches, so that the compiler can help ensure the code is updated when a +new type is added. -`executable_semantics` never uses plain pointer types directly. Instead, we use -the [`Nonnull`](common/nonnull.h) alias for pointers that are not nullable, -or `std::optional>` for pointers that are nullable. +`explorer` never uses plain pointer types directly. Instead, we use the +[`Nonnull`](common/nonnull.h) alias for pointers that are not nullable, or +`std::optional>` for pointers that are nullable. -Many of the most commonly-used objects in `executable_semantics` have lifetimes -that are tied to the lifespan of the entire Carbon program. We manage the -lifetimes of those objects by allocating them through an -[`Arena`](common/arena.h) object, which can allocate objects of arbitrary types, -and retains ownership of them. As of this writing, all of `executable_semantics` -uses a single `Arena` object, we may introduce multiple `Arena`s for different -lifetime groups in the future. +Many of the most commonly-used objects in `explorer` have lifetimes that are +tied to the lifespan of the entire Carbon program. We manage the lifetimes of +those objects by allocating them through an [`Arena`](common/arena.h) object, +which can allocate objects of arbitrary types, and retains ownership of them. As +of this writing, all of `explorer` uses a single `Arena` object, we may +introduce multiple `Arena`s for different lifetime groups in the future. -For simplicity, `executable_semantics` generally treats all errors as fatal. -Errors caused by bugs in the user-provided Carbon code should be reported with -the error builders in [`error_builders.h`](common/error_builders.h). Errors -caused by bugs in `executable_semantics` itself should be reported with +For simplicity, `explorer` generally treats all errors as fatal. Errors caused +by bugs in the user-provided Carbon code should be reported with the error +builders in [`error_builders.h`](common/error_builders.h). Errors caused by bugs +in `explorer` itself should be reported with [`CHECK` or `FATAL`](../common/check.h). ## Example Programs (Regression Tests) @@ -73,14 +72,14 @@ boilerplate at the top: // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: executable_semantics %s 2>&1 | \ +// RUN: explorer %s 2>&1 | \ // RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s -// RUN: executable_semantics --trace %s 2>&1 | \ +// RUN: explorer --trace %s 2>&1 | \ // RUN: FileCheck --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: executable_semantics %s +// AUTOUPDATE: explorer %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; ``` To explain this boilerplate: @@ -97,7 +96,7 @@ To explain this boilerplate: line must match a complete output line, with no extra characters before or after the `CHECK` pattern. - `RUN:` will be followed by the `not` command when failure is expected. - In particular, `RUN: not executable_semantics ...`. + In particular, `RUN: not explorer ...`. - `%s` is a [`lit` substitution](https://llvm.org/docs/CommandGuide/lit.html#substitutions) for the path to the given test file. diff --git a/executable_semantics/ast/BUILD b/explorer/ast/BUILD similarity index 74% rename from executable_semantics/ast/BUILD rename to explorer/ast/BUILD index 359c13f31f7f..89f785c37883 100644 --- a/executable_semantics/ast/BUILD +++ b/explorer/ast/BUILD @@ -2,7 +2,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -package(default_visibility = ["//executable_semantics:__subpackages__"]) +package(default_visibility = ["//explorer:__subpackages__"]) cc_library( name = "ast", @@ -10,7 +10,7 @@ cc_library( deps = [ ":declaration", ":library_name", - "//executable_semantics/common:nonnull", + "//explorer/common:nonnull", ], ) @@ -22,7 +22,7 @@ cc_library( "ast_rtti.h", ], deps = [ - "//executable_semantics/common:source_location", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) @@ -31,9 +31,9 @@ genrule( name = "ast_rtti", srcs = ["ast_rtti.txt"], outs = ["ast_rtti.h"], - cmd = "./$(location //executable_semantics:gen_rtti)" + + cmd = "./$(location //explorer:gen_rtti)" + " $(location ast_rtti.txt) > \"$@\"", - tools = ["//executable_semantics:gen_rtti"], + tools = ["//explorer:gen_rtti"], ) cc_library( @@ -65,7 +65,7 @@ cc_test( ":pattern", ":statement", "//common:gtest_main", - "//executable_semantics/common:arena", + "//explorer/common:arena", "@com_google_googletest//:gtest", ], ) @@ -81,8 +81,8 @@ cc_library( ":value_category", "//common:check", "//common:ostream", - "//executable_semantics/common:nonnull", - "//executable_semantics/common:source_location", + "//explorer/common:nonnull", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) @@ -102,8 +102,8 @@ cc_library( ":static_scope", ":value_category", "//common:ostream", - "//executable_semantics/common:nonnull", - "//executable_semantics/common:source_location", + "//explorer/common:nonnull", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) @@ -115,8 +115,8 @@ cc_library( ":expression", "//common:check", "//common:ostream", - "//executable_semantics/common:nonnull", - "//executable_semantics/common:source_location", + "//explorer/common:nonnull", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) @@ -132,9 +132,9 @@ cc_library( ":value_category", "//common:indirect_value", "//common:ostream", - "//executable_semantics/common:arena", - "//executable_semantics/common:error_builders", - "//executable_semantics/common:source_location", + "//explorer/common:arena", + "//explorer/common:error_builders", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) @@ -146,7 +146,7 @@ cc_test( ":expression", ":paren_contents", "//common:gtest_main", - "//executable_semantics/common:arena", + "//explorer/common:arena", "@com_google_googletest//:gtest", "@llvm-project//llvm:Support", ], @@ -161,8 +161,8 @@ cc_library( name = "paren_contents", hdrs = ["paren_contents.h"], deps = [ - "//executable_semantics/common:error_builders", - "//executable_semantics/common:source_location", + "//explorer/common:error_builders", + "//explorer/common:source_location", ], ) @@ -176,9 +176,9 @@ cc_library( ":static_scope", ":value_category", "//common:ostream", - "//executable_semantics/common:arena", - "//executable_semantics/common:error_builders", - "//executable_semantics/common:source_location", + "//explorer/common:arena", + "//explorer/common:error_builders", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) @@ -191,7 +191,7 @@ cc_test( ":paren_contents", ":pattern", "//common:gtest_main", - "//executable_semantics/common:arena", + "//explorer/common:arena", "@com_google_googletest//:gtest", "@llvm-project//llvm:Support", ], @@ -206,9 +206,9 @@ cc_library( ":value_category", "//common:check", "//common:error", - "//executable_semantics/common:error_builders", - "//executable_semantics/common:nonnull", - "//executable_semantics/common:source_location", + "//explorer/common:error_builders", + "//explorer/common:nonnull", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) @@ -226,8 +226,8 @@ cc_library( ":value_category", "//common:check", "//common:ostream", - "//executable_semantics/common:arena", - "//executable_semantics/common:source_location", + "//explorer/common:arena", + "//explorer/common:source_location", "@llvm-project//llvm:Support", ], ) diff --git a/executable_semantics/ast/README.md b/explorer/ast/README.md similarity index 98% rename from executable_semantics/ast/README.md rename to explorer/ast/README.md index 448045e8b32b..2687502f666f 100644 --- a/executable_semantics/ast/README.md +++ b/explorer/ast/README.md @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception --> The code in this directory defines the AST that represents Carbon code in the -rest of `executable-semantics`. +rest of `explorer`. The AST is not quite immutable, because some node properties are set during some phase of static analysis, rather than during parsing. However, AST mutations are diff --git a/executable_semantics/ast/ast.h b/explorer/ast/ast.h similarity index 71% rename from executable_semantics/ast/ast.h rename to explorer/ast/ast.h index 2e016223d633..0f890eb7b2e1 100644 --- a/executable_semantics/ast/ast.h +++ b/explorer/ast/ast.h @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_AST_H_ -#define EXECUTABLE_SEMANTICS_AST_AST_H_ +#ifndef EXPLORER_AST_AST_H_ +#define EXPLORER_AST_AST_H_ #include -#include "executable_semantics/ast/declaration.h" -#include "executable_semantics/ast/library_name.h" -#include "executable_semantics/common/nonnull.h" +#include "explorer/ast/declaration.h" +#include "explorer/ast/library_name.h" +#include "explorer/common/nonnull.h" namespace Carbon { @@ -29,4 +29,4 @@ struct AST { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_AST_H_ +#endif // EXPLORER_AST_AST_H_ diff --git a/executable_semantics/ast/ast_node.cpp b/explorer/ast/ast_node.cpp similarity index 85% rename from executable_semantics/ast/ast_node.cpp rename to explorer/ast/ast_node.cpp index 2c0554d2a036..e2cbfcdc9d2a 100644 --- a/executable_semantics/ast/ast_node.cpp +++ b/explorer/ast/ast_node.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/ast_node.h" +#include "explorer/ast/ast_node.h" namespace Carbon { diff --git a/executable_semantics/ast/ast_node.h b/explorer/ast/ast_node.h similarity index 91% rename from executable_semantics/ast/ast_node.h rename to explorer/ast/ast_node.h index 8c0724d95a26..49a0f6270a05 100644 --- a/executable_semantics/ast/ast_node.h +++ b/explorer/ast/ast_node.h @@ -2,11 +2,11 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_AST_NODE_H_ -#define EXECUTABLE_SEMANTICS_AST_AST_NODE_H_ +#ifndef EXPLORER_AST_AST_NODE_H_ +#define EXPLORER_AST_AST_NODE_H_ -#include "executable_semantics/ast/ast_rtti.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/ast/ast_rtti.h" +#include "explorer/common/source_location.h" #include "llvm/Support/Casting.h" namespace Carbon { @@ -76,4 +76,4 @@ class AstNode { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_AST_NODE_H_ +#endif // EXPLORER_AST_AST_NODE_H_ diff --git a/executable_semantics/ast/ast_rtti.txt b/explorer/ast/ast_rtti.txt similarity index 100% rename from executable_semantics/ast/ast_rtti.txt rename to explorer/ast/ast_rtti.txt diff --git a/executable_semantics/ast/ast_test_matchers.h b/explorer/ast/ast_test_matchers.h similarity index 93% rename from executable_semantics/ast/ast_test_matchers.h rename to explorer/ast/ast_test_matchers.h index 53113989f065..b98a4265f58c 100644 --- a/executable_semantics/ast/ast_test_matchers.h +++ b/explorer/ast/ast_test_matchers.h @@ -9,17 +9,17 @@ // TODO: Provide matchers for all node Kinds, and establish more uniform // conventions for them. -#ifndef EXECUTABLE_SEMANTICS_AST_AST_TEST_MATCHERS_H_ -#define EXECUTABLE_SEMANTICS_AST_AST_TEST_MATCHERS_H_ +#ifndef EXPLORER_AST_AST_TEST_MATCHERS_H_ +#define EXPLORER_AST_AST_TEST_MATCHERS_H_ #include #include #include -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/ast_test_matchers_internal.h" -#include "executable_semantics/ast/expression.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/ast_test_matchers_internal.h" +#include "explorer/ast/expression.h" namespace Carbon { @@ -129,4 +129,4 @@ inline auto ASTDeclarations( } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_AST_TEST_MATCHERS_H_ +#endif // EXPLORER_AST_AST_TEST_MATCHERS_H_ diff --git a/executable_semantics/ast/ast_test_matchers_internal.cpp b/explorer/ast/ast_test_matchers_internal.cpp similarity index 99% rename from executable_semantics/ast/ast_test_matchers_internal.cpp rename to explorer/ast/ast_test_matchers_internal.cpp index 1cef574c7a15..84d5cda9c838 100644 --- a/executable_semantics/ast/ast_test_matchers_internal.cpp +++ b/explorer/ast/ast_test_matchers_internal.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/ast_test_matchers_internal.h" +#include "explorer/ast/ast_test_matchers_internal.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/raw_ostream.h" diff --git a/executable_semantics/ast/ast_test_matchers_internal.h b/explorer/ast/ast_test_matchers_internal.h similarity index 94% rename from executable_semantics/ast/ast_test_matchers_internal.h rename to explorer/ast/ast_test_matchers_internal.h index 8d35dacb7b01..cd3c55d304da 100644 --- a/executable_semantics/ast/ast_test_matchers_internal.h +++ b/explorer/ast/ast_test_matchers_internal.h @@ -4,19 +4,19 @@ // Implementation details of the functions in ast_test_matchers.h. -#ifndef EXECUTABLE_SEMANTICS_AST_AST_TEST_MATCHERS_INTERNAL_H_ -#define EXECUTABLE_SEMANTICS_AST_AST_TEST_MATCHERS_INTERNAL_H_ +#ifndef EXPLORER_AST_AST_TEST_MATCHERS_INTERNAL_H_ +#define EXPLORER_AST_AST_TEST_MATCHERS_INTERNAL_H_ #include #include #include -#include "executable_semantics/ast/ast.h" -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/declaration.h" -#include "executable_semantics/ast/expression.h" -#include "executable_semantics/ast/statement.h" +#include "explorer/ast/ast.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/declaration.h" +#include "explorer/ast/expression.h" +#include "explorer/ast/statement.h" #include "llvm/Support/Casting.h" namespace Carbon::TestingInternal { @@ -234,4 +234,4 @@ class ASTDeclarationsMatcher { } // namespace Carbon::TestingInternal -#endif // EXECUTABLE_SEMANTICS_AST_AST_TEST_MATCHERS_INTERNAL_H_ +#endif // EXPLORER_AST_AST_TEST_MATCHERS_INTERNAL_H_ diff --git a/executable_semantics/ast/ast_test_matchers_test.cpp b/explorer/ast/ast_test_matchers_test.cpp similarity index 95% rename from executable_semantics/ast/ast_test_matchers_test.cpp rename to explorer/ast/ast_test_matchers_test.cpp index b4c4a2d097ce..819d73945fe4 100644 --- a/executable_semantics/ast/ast_test_matchers_test.cpp +++ b/explorer/ast/ast_test_matchers_test.cpp @@ -2,16 +2,16 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/ast_test_matchers.h" +#include "explorer/ast/ast_test_matchers.h" #include #include -#include "executable_semantics/ast/declaration.h" -#include "executable_semantics/ast/expression.h" -#include "executable_semantics/ast/pattern.h" -#include "executable_semantics/ast/statement.h" -#include "executable_semantics/common/arena.h" +#include "explorer/ast/declaration.h" +#include "explorer/ast/expression.h" +#include "explorer/ast/pattern.h" +#include "explorer/ast/statement.h" +#include "explorer/common/arena.h" namespace Carbon::Testing { namespace { diff --git a/executable_semantics/ast/declaration.cpp b/explorer/ast/declaration.cpp similarity index 99% rename from executable_semantics/ast/declaration.cpp rename to explorer/ast/declaration.cpp index 6d530c10cec0..ab23fab5484e 100644 --- a/executable_semantics/ast/declaration.cpp +++ b/explorer/ast/declaration.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/declaration.h" +#include "explorer/ast/declaration.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Casting.h" diff --git a/executable_semantics/ast/declaration.h b/explorer/ast/declaration.h similarity index 95% rename from executable_semantics/ast/declaration.h rename to explorer/ast/declaration.h index 8a3d5d573343..5f47976b1ec2 100644 --- a/executable_semantics/ast/declaration.h +++ b/explorer/ast/declaration.h @@ -2,23 +2,23 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_DECLARATION_H_ -#define EXECUTABLE_SEMANTICS_AST_DECLARATION_H_ +#ifndef EXPLORER_AST_DECLARATION_H_ +#define EXPLORER_AST_DECLARATION_H_ #include #include #include #include "common/ostream.h" -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/impl_binding.h" -#include "executable_semantics/ast/pattern.h" -#include "executable_semantics/ast/return_term.h" -#include "executable_semantics/ast/statement.h" -#include "executable_semantics/ast/static_scope.h" -#include "executable_semantics/ast/value_category.h" -#include "executable_semantics/common/nonnull.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/impl_binding.h" +#include "explorer/ast/pattern.h" +#include "explorer/ast/return_term.h" +#include "explorer/ast/statement.h" +#include "explorer/ast/static_scope.h" +#include "explorer/ast/value_category.h" +#include "explorer/common/nonnull.h" +#include "explorer/common/source_location.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Compiler.h" @@ -397,4 +397,4 @@ auto GetName(const Declaration&) -> std::optional; } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_DECLARATION_H_ +#endif // EXPLORER_AST_DECLARATION_H_ diff --git a/executable_semantics/ast/expression.cpp b/explorer/ast/expression.cpp similarity index 98% rename from executable_semantics/ast/expression.cpp rename to explorer/ast/expression.cpp index 4150c73cd7c5..731ef664246b 100644 --- a/executable_semantics/ast/expression.cpp +++ b/explorer/ast/expression.cpp @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/expression.h" +#include "explorer/ast/expression.h" #include #include -#include "executable_semantics/common/arena.h" -#include "executable_semantics/common/error_builders.h" +#include "explorer/common/arena.h" +#include "explorer/common/error_builders.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Casting.h" #include "llvm/Support/raw_ostream.h" diff --git a/executable_semantics/ast/expression.h b/explorer/ast/expression.h similarity index 97% rename from executable_semantics/ast/expression.h rename to explorer/ast/expression.h index 98a71226796e..7f9305e3d466 100644 --- a/executable_semantics/ast/expression.h +++ b/explorer/ast/expression.h @@ -2,8 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_EXPRESSION_H_ -#define EXECUTABLE_SEMANTICS_AST_EXPRESSION_H_ +#ifndef EXPLORER_AST_EXPRESSION_H_ +#define EXPLORER_AST_EXPRESSION_H_ #include #include @@ -12,12 +12,12 @@ #include #include "common/ostream.h" -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/paren_contents.h" -#include "executable_semantics/ast/static_scope.h" -#include "executable_semantics/ast/value_category.h" -#include "executable_semantics/common/arena.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/paren_contents.h" +#include "explorer/ast/static_scope.h" +#include "explorer/ast/value_category.h" +#include "explorer/common/arena.h" +#include "explorer/common/source_location.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Compiler.h" @@ -652,4 +652,4 @@ auto TupleExpressionFromParenContents( } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_EXPRESSION_H_ +#endif // EXPLORER_AST_EXPRESSION_H_ diff --git a/executable_semantics/ast/expression_test.cpp b/explorer/ast/expression_test.cpp similarity index 97% rename from executable_semantics/ast/expression_test.cpp rename to explorer/ast/expression_test.cpp index 131ca9142feb..883d30799e58 100644 --- a/executable_semantics/ast/expression_test.cpp +++ b/explorer/ast/expression_test.cpp @@ -2,15 +2,15 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/expression.h" +#include "explorer/ast/expression.h" #include #include #include -#include "executable_semantics/ast/paren_contents.h" -#include "executable_semantics/common/arena.h" +#include "explorer/ast/paren_contents.h" +#include "explorer/common/arena.h" #include "llvm/Support/Casting.h" namespace Carbon::Testing { diff --git a/executable_semantics/ast/impl_binding.h b/explorer/ast/impl_binding.h similarity index 88% rename from executable_semantics/ast/impl_binding.h rename to explorer/ast/impl_binding.h index 96960f4777b5..8229c6664028 100644 --- a/executable_semantics/ast/impl_binding.h +++ b/explorer/ast/impl_binding.h @@ -2,16 +2,16 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_GENERIC_BINDING_H_ -#define EXECUTABLE_SEMANTICS_AST_GENERIC_BINDING_H_ +#ifndef EXPLORER_AST_GENERIC_BINDING_H_ +#define EXPLORER_AST_GENERIC_BINDING_H_ #include #include "common/check.h" #include "common/ostream.h" -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/pattern.h" -#include "executable_semantics/ast/value_category.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/pattern.h" +#include "explorer/ast/value_category.h" namespace Carbon { @@ -75,4 +75,4 @@ class ImplBinding : public AstNode { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_GENERIC_BINDING_H_ +#endif // EXPLORER_AST_GENERIC_BINDING_H_ diff --git a/executable_semantics/ast/library_name.h b/explorer/ast/library_name.h similarity index 79% rename from executable_semantics/ast/library_name.h rename to explorer/ast/library_name.h index 31c1249147d4..256ad73f9f4d 100644 --- a/executable_semantics/ast/library_name.h +++ b/explorer/ast/library_name.h @@ -2,8 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_LIBRARY_NAME_H_ -#define EXECUTABLE_SEMANTICS_AST_LIBRARY_NAME_H_ +#ifndef EXPLORER_AST_LIBRARY_NAME_H_ +#define EXPLORER_AST_LIBRARY_NAME_H_ #include @@ -22,4 +22,4 @@ struct LibraryName { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_LIBRARY_NAME_H_ +#endif // EXPLORER_AST_LIBRARY_NAME_H_ diff --git a/executable_semantics/ast/paren_contents.h b/explorer/ast/paren_contents.h similarity index 84% rename from executable_semantics/ast/paren_contents.h rename to explorer/ast/paren_contents.h index 0872bb82282e..c749f6715ec8 100644 --- a/executable_semantics/ast/paren_contents.h +++ b/explorer/ast/paren_contents.h @@ -2,15 +2,15 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_PAREN_CONTENTS_H_ -#define EXECUTABLE_SEMANTICS_AST_PAREN_CONTENTS_H_ +#ifndef EXPLORER_AST_PAREN_CONTENTS_H_ +#define EXPLORER_AST_PAREN_CONTENTS_H_ #include #include #include -#include "executable_semantics/common/error_builders.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/common/error_builders.h" +#include "explorer/common/source_location.h" namespace Carbon { @@ -48,4 +48,4 @@ auto ParenContents::SingleTerm() const -> std::optional> { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_PAREN_CONTENTS_H_ +#endif // EXPLORER_AST_PAREN_CONTENTS_H_ diff --git a/executable_semantics/ast/pattern.cpp b/explorer/ast/pattern.cpp similarity index 96% rename from executable_semantics/ast/pattern.cpp rename to explorer/ast/pattern.cpp index bda4f4369850..c3417b44e6b4 100644 --- a/executable_semantics/ast/pattern.cpp +++ b/explorer/ast/pattern.cpp @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/pattern.h" +#include "explorer/ast/pattern.h" #include #include "common/ostream.h" -#include "executable_semantics/ast/expression.h" -#include "executable_semantics/common/arena.h" -#include "executable_semantics/common/error_builders.h" +#include "explorer/ast/expression.h" +#include "explorer/common/arena.h" +#include "explorer/common/error_builders.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Casting.h" diff --git a/executable_semantics/ast/pattern.h b/explorer/ast/pattern.h similarity index 96% rename from executable_semantics/ast/pattern.h rename to explorer/ast/pattern.h index 5e183278c314..5670198834f6 100644 --- a/executable_semantics/ast/pattern.h +++ b/explorer/ast/pattern.h @@ -2,20 +2,20 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_PATTERN_H_ -#define EXECUTABLE_SEMANTICS_AST_PATTERN_H_ +#ifndef EXPLORER_AST_PATTERN_H_ +#define EXPLORER_AST_PATTERN_H_ #include #include #include #include "common/ostream.h" -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/ast_rtti.h" -#include "executable_semantics/ast/expression.h" -#include "executable_semantics/ast/static_scope.h" -#include "executable_semantics/ast/value_category.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/ast_rtti.h" +#include "explorer/ast/expression.h" +#include "explorer/ast/static_scope.h" +#include "explorer/ast/value_category.h" +#include "explorer/common/source_location.h" #include "llvm/ADT/ArrayRef.h" namespace Carbon { @@ -344,4 +344,4 @@ class ExpressionPattern : public Pattern { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_PATTERN_H_ +#endif // EXPLORER_AST_PATTERN_H_ diff --git a/executable_semantics/ast/pattern_test.cpp b/explorer/ast/pattern_test.cpp similarity index 95% rename from executable_semantics/ast/pattern_test.cpp rename to explorer/ast/pattern_test.cpp index ffa2fa7fb24f..419cda0c02cf 100644 --- a/executable_semantics/ast/pattern_test.cpp +++ b/explorer/ast/pattern_test.cpp @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/pattern.h" +#include "explorer/ast/pattern.h" #include #include -#include "executable_semantics/ast/expression.h" -#include "executable_semantics/ast/paren_contents.h" -#include "executable_semantics/common/arena.h" +#include "explorer/ast/expression.h" +#include "explorer/ast/paren_contents.h" +#include "explorer/common/arena.h" #include "llvm/Support/Casting.h" namespace Carbon::Testing { diff --git a/executable_semantics/ast/return_term.h b/explorer/ast/return_term.h similarity index 91% rename from executable_semantics/ast/return_term.h rename to explorer/ast/return_term.h index 593d322e656a..71eba999acb4 100644 --- a/executable_semantics/ast/return_term.h +++ b/explorer/ast/return_term.h @@ -2,17 +2,17 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_RETURN_TERM_H_ -#define EXECUTABLE_SEMANTICS_AST_RETURN_TERM_H_ +#ifndef EXPLORER_AST_RETURN_TERM_H_ +#define EXPLORER_AST_RETURN_TERM_H_ #include #include #include "common/check.h" #include "common/ostream.h" -#include "executable_semantics/ast/expression.h" -#include "executable_semantics/common/nonnull.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/ast/expression.h" +#include "explorer/common/nonnull.h" +#include "explorer/common/source_location.h" namespace Carbon { @@ -97,4 +97,4 @@ class ReturnTerm { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_RETURN_TERM_H_ +#endif // EXPLORER_AST_RETURN_TERM_H_ diff --git a/executable_semantics/ast/statement.cpp b/explorer/ast/statement.cpp similarity index 97% rename from executable_semantics/ast/statement.cpp rename to explorer/ast/statement.cpp index cb3a0317074c..66ff21fbb9b9 100644 --- a/executable_semantics/ast/statement.cpp +++ b/explorer/ast/statement.cpp @@ -2,10 +2,10 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/statement.h" +#include "explorer/ast/statement.h" #include "common/check.h" -#include "executable_semantics/common/arena.h" +#include "explorer/common/arena.h" #include "llvm/Support/Casting.h" namespace Carbon { diff --git a/executable_semantics/ast/statement.h b/explorer/ast/statement.h similarity index 95% rename from executable_semantics/ast/statement.h rename to explorer/ast/statement.h index 432595f8c28a..fa25d8659ef3 100644 --- a/executable_semantics/ast/statement.h +++ b/explorer/ast/statement.h @@ -2,21 +2,21 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_STATEMENT_H_ -#define EXECUTABLE_SEMANTICS_AST_STATEMENT_H_ +#ifndef EXPLORER_AST_STATEMENT_H_ +#define EXPLORER_AST_STATEMENT_H_ #include #include #include "common/ostream.h" -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/expression.h" -#include "executable_semantics/ast/pattern.h" -#include "executable_semantics/ast/return_term.h" -#include "executable_semantics/ast/static_scope.h" -#include "executable_semantics/ast/value_category.h" -#include "executable_semantics/common/arena.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/expression.h" +#include "explorer/ast/pattern.h" +#include "explorer/ast/return_term.h" +#include "explorer/ast/static_scope.h" +#include "explorer/ast/value_category.h" +#include "explorer/common/arena.h" +#include "explorer/common/source_location.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Compiler.h" @@ -395,4 +395,4 @@ class Await : public Statement { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_STATEMENT_H_ +#endif // EXPLORER_AST_STATEMENT_H_ diff --git a/executable_semantics/ast/static_scope.cpp b/explorer/ast/static_scope.cpp similarity index 94% rename from executable_semantics/ast/static_scope.cpp rename to explorer/ast/static_scope.cpp index 985919cfda54..002a1daf017a 100644 --- a/executable_semantics/ast/static_scope.cpp +++ b/explorer/ast/static_scope.cpp @@ -2,9 +2,9 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/ast/static_scope.h" +#include "explorer/ast/static_scope.h" -#include "executable_semantics/common/error_builders.h" +#include "explorer/common/error_builders.h" #include "llvm/Support/Error.h" namespace Carbon { diff --git a/executable_semantics/ast/static_scope.h b/explorer/ast/static_scope.h similarity index 94% rename from executable_semantics/ast/static_scope.h rename to explorer/ast/static_scope.h index ea91025924b0..0364ef19959d 100644 --- a/executable_semantics/ast/static_scope.h +++ b/explorer/ast/static_scope.h @@ -2,8 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_STATIC_SCOPE_H_ -#define EXECUTABLE_SEMANTICS_AST_STATIC_SCOPE_H_ +#ifndef EXPLORER_AST_STATIC_SCOPE_H_ +#define EXPLORER_AST_STATIC_SCOPE_H_ #include #include @@ -13,10 +13,10 @@ #include "common/check.h" #include "common/error.h" -#include "executable_semantics/ast/ast_node.h" -#include "executable_semantics/ast/value_category.h" -#include "executable_semantics/common/nonnull.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/ast/ast_node.h" +#include "explorer/ast/value_category.h" +#include "explorer/common/nonnull.h" +#include "explorer/common/source_location.h" #include "llvm/Support/Error.h" namespace Carbon { @@ -183,4 +183,4 @@ class StaticScope { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_STATIC_SCOPE_H_ +#endif // EXPLORER_AST_STATIC_SCOPE_H_ diff --git a/executable_semantics/ast/value_category.h b/explorer/ast/value_category.h similarity index 79% rename from executable_semantics/ast/value_category.h rename to explorer/ast/value_category.h index 45f70e3ec10c..b286591b9d1b 100644 --- a/executable_semantics/ast/value_category.h +++ b/explorer/ast/value_category.h @@ -2,8 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_AST_VALUE_CATEGORY_H_ -#define EXECUTABLE_SEMANTICS_AST_VALUE_CATEGORY_H_ +#ifndef EXPLORER_AST_VALUE_CATEGORY_H_ +#define EXPLORER_AST_VALUE_CATEGORY_H_ namespace Carbon { @@ -19,4 +19,4 @@ enum class ValueCategory { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_AST_VALUE_CATEGORY_H_ +#endif // EXPLORER_AST_VALUE_CATEGORY_H_ diff --git a/executable_semantics/common/BUILD b/explorer/common/BUILD similarity index 92% rename from executable_semantics/common/BUILD rename to explorer/common/BUILD index 55adf6e7ad2b..b2c684ddb4da 100644 --- a/executable_semantics/common/BUILD +++ b/explorer/common/BUILD @@ -2,7 +2,7 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -package(default_visibility = ["//executable_semantics:__subpackages__"]) +package(default_visibility = ["//explorer:__subpackages__"]) cc_library( name = "arena", diff --git a/executable_semantics/common/arena.h b/explorer/common/arena.h similarity index 88% rename from executable_semantics/common/arena.h rename to explorer/common/arena.h index d4cb077c2b6e..122f0fbecbd8 100644 --- a/executable_semantics/common/arena.h +++ b/explorer/common/arena.h @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_COMMON_ARENA_H_ -#define EXECUTABLE_SEMANTICS_COMMON_ARENA_H_ +#ifndef EXPLORER_COMMON_ARENA_H_ +#define EXPLORER_COMMON_ARENA_H_ #include #include #include -#include "executable_semantics/common/nonnull.h" +#include "explorer/common/nonnull.h" namespace Carbon { @@ -55,4 +55,4 @@ class Arena { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_COMMON_ARENA_H_ +#endif // EXPLORER_COMMON_ARENA_H_ diff --git a/executable_semantics/common/error_builders.h b/explorer/common/error_builders.h similarity index 84% rename from executable_semantics/common/error_builders.h rename to explorer/common/error_builders.h index 5a140168bf50..ffab5cbbec9c 100644 --- a/executable_semantics/common/error_builders.h +++ b/explorer/common/error_builders.h @@ -2,11 +2,11 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_COMMON_ERROR_BUILDERS_H_ -#define EXECUTABLE_SEMANTICS_COMMON_ERROR_BUILDERS_H_ +#ifndef EXPLORER_COMMON_ERROR_BUILDERS_H_ +#define EXPLORER_COMMON_ERROR_BUILDERS_H_ #include "common/error.h" -#include "executable_semantics/common/source_location.h" +#include "explorer/common/source_location.h" namespace Carbon { @@ -41,4 +41,4 @@ inline auto RuntimeError(SourceLocation loc) -> ErrorBuilder { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_COMMON_ERROR_BUILDERS_H_ +#endif // EXPLORER_COMMON_ERROR_BUILDERS_H_ diff --git a/executable_semantics/common/error_builders_test.cpp b/explorer/common/error_builders_test.cpp similarity index 87% rename from executable_semantics/common/error_builders_test.cpp rename to explorer/common/error_builders_test.cpp index 8aef7f970847..f4ac9fd50dc7 100644 --- a/executable_semantics/common/error_builders_test.cpp +++ b/explorer/common/error_builders_test.cpp @@ -2,11 +2,11 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/common/error_builders.h" +#include "explorer/common/error_builders.h" #include -#include "executable_semantics/common/source_location.h" +#include "explorer/common/source_location.h" namespace Carbon::Testing { namespace { diff --git a/executable_semantics/common/nonnull.h b/explorer/common/nonnull.h similarity index 81% rename from executable_semantics/common/nonnull.h rename to explorer/common/nonnull.h index e22788a2761f..cfbb01e66d1c 100644 --- a/executable_semantics/common/nonnull.h +++ b/explorer/common/nonnull.h @@ -2,8 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_COMMON_NONNULL_H_ -#define EXECUTABLE_SEMANTICS_COMMON_NONNULL_H_ +#ifndef EXPLORER_COMMON_NONNULL_H_ +#define EXPLORER_COMMON_NONNULL_H_ #include @@ -19,4 +19,4 @@ using Nonnull = T _Nonnull; } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_COMMON_NONNULL_H_ +#endif // EXPLORER_COMMON_NONNULL_H_ diff --git a/executable_semantics/common/source_location.h b/explorer/common/source_location.h similarity index 85% rename from executable_semantics/common/source_location.h rename to explorer/common/source_location.h index 9f4c3dad30e3..147f20b5bfda 100644 --- a/executable_semantics/common/source_location.h +++ b/explorer/common/source_location.h @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef EXECUTABLE_SEMANTICS_COMMON_SOURCE_LOCATION_H_ -#define EXECUTABLE_SEMANTICS_COMMON_SOURCE_LOCATION_H_ +#ifndef EXPLORER_COMMON_SOURCE_LOCATION_H_ +#define EXPLORER_COMMON_SOURCE_LOCATION_H_ #include #include #include "common/ostream.h" -#include "executable_semantics/common/nonnull.h" +#include "explorer/common/nonnull.h" namespace Carbon { @@ -42,4 +42,4 @@ class SourceLocation { } // namespace Carbon -#endif // EXECUTABLE_SEMANTICS_COMMON_SOURCE_LOCATION_H_ +#endif // EXPLORER_COMMON_SOURCE_LOCATION_H_ diff --git a/executable_semantics/data/prelude.carbon b/explorer/data/prelude.carbon similarity index 100% rename from executable_semantics/data/prelude.carbon rename to explorer/data/prelude.carbon diff --git a/executable_semantics/fuzzing/BUILD b/explorer/fuzzing/BUILD similarity index 70% rename from executable_semantics/fuzzing/BUILD rename to explorer/fuzzing/BUILD index 59c6daf6ef7c..ff0b47d592f9 100644 --- a/executable_semantics/fuzzing/BUILD +++ b/explorer/fuzzing/BUILD @@ -11,9 +11,9 @@ cc_library( hdrs = ["ast_to_proto.h"], deps = [ "//common/fuzzing:carbon_cc_proto", - "//executable_semantics/ast", - "//executable_semantics/ast:declaration", - "//executable_semantics/ast:expression", + "//explorer/ast", + "//explorer/ast:declaration", + "//explorer/ast:expression", "@llvm-project//llvm:Support", ], ) @@ -27,9 +27,9 @@ cc_library( "//common:check", "//common/fuzzing:carbon_cc_proto", "//common/fuzzing:proto_to_carbon_lib", - "//executable_semantics/interpreter:exec_program", - "//executable_semantics/syntax", - "//executable_semantics/syntax:prelude", + "//explorer/interpreter:exec_program", + "//explorer/syntax", + "//explorer/syntax:prelude", "@com_google_protobuf//:protobuf_headers", "@llvm-project//llvm:Support", ], @@ -39,17 +39,17 @@ cc_test( name = "ast_to_proto_test", srcs = ["ast_to_proto_test.cpp"], args = [ - "$(locations //executable_semantics:standard_libraries)", - "$(locations //executable_semantics/testdata:carbon_files)", + "$(locations //explorer:standard_libraries)", + "$(locations //explorer/testdata:carbon_files)", ], data = [ - "//executable_semantics:standard_libraries", - "//executable_semantics/testdata:carbon_files", + "//explorer:standard_libraries", + "//explorer/testdata:carbon_files", ], deps = [ ":ast_to_proto_lib", "//common/fuzzing:carbon_cc_proto", - "//executable_semantics/syntax", + "//explorer/syntax", "@com_google_googletest//:gtest", "@com_google_protobuf//:protobuf_headers", "@llvm-project//llvm:Support", @@ -65,9 +65,9 @@ cc_binary( ":fuzzer_util", "//common:error", "//common/fuzzing:carbon_cc_proto", - "//executable_semantics/common:error_builders", - "//executable_semantics/common:nonnull", - "//executable_semantics/syntax", + "//explorer/common:error_builders", + "//explorer/common:nonnull", + "//explorer/syntax", "@com_google_protobuf//:protobuf_headers", "@llvm-project//llvm:Support", ], @@ -99,18 +99,18 @@ cc_test( name = "proto_to_carbon_test", srcs = ["proto_to_carbon_test.cpp"], args = [ - "$(locations //executable_semantics:standard_libraries)", - "$(locations //executable_semantics/testdata:carbon_files)", + "$(locations //explorer:standard_libraries)", + "$(locations //explorer/testdata:carbon_files)", ], data = [ - "//executable_semantics:standard_libraries", - "//executable_semantics/testdata:carbon_files", + "//explorer:standard_libraries", + "//explorer/testdata:carbon_files", ], deps = [ ":ast_to_proto_lib", "//common/fuzzing:carbon_cc_proto", "//common/fuzzing:proto_to_carbon_lib", - "//executable_semantics/syntax", + "//explorer/syntax", "@com_google_googletest//:gtest", "@com_google_protobuf//:protobuf_headers", "@llvm-project//llvm:Support", @@ -119,9 +119,9 @@ cc_test( # Needs `--config=proto-fuzzer` for `bazel build`. cc_binary( - name = "executable_semantics_fuzzer", + name = "explorer_fuzzer", testonly = 1, - srcs = ["executable_semantics_fuzzer.cpp"], + srcs = ["explorer_fuzzer.cpp"], features = ["fuzzer"], deps = [ ":fuzzer_util", diff --git a/executable_semantics/fuzzing/README.md b/explorer/fuzzing/README.md similarity index 65% rename from executable_semantics/fuzzing/README.md rename to explorer/fuzzing/README.md index 96baf9d273f0..35203d6cfd5d 100644 --- a/executable_semantics/fuzzing/README.md +++ b/explorer/fuzzing/README.md @@ -1,4 +1,4 @@ -# Executable semantics structured fuzzer +# Explorer structured fuzzer // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { return 0; diff --git a/executable_semantics/testdata/basic_syntax/var_tuple.carbon b/explorer/testdata/basic_syntax/var_tuple.carbon similarity index 68% rename from executable_semantics/testdata/basic_syntax/var_tuple.carbon rename to explorer/testdata/basic_syntax/var_tuple.carbon index ca52b026939d..b3c503a823fe 100644 --- a/executable_semantics/testdata/basic_syntax/var_tuple.carbon +++ b/explorer/testdata/basic_syntax/var_tuple.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var (x: auto, y: auto) = (2, 3); diff --git a/executable_semantics/testdata/basic_syntax/zero.carbon b/explorer/testdata/basic_syntax/zero.carbon similarity index 66% rename from executable_semantics/testdata/basic_syntax/zero.carbon rename to explorer/testdata/basic_syntax/zero.carbon index c65ff74395ae..ceccaab4a654 100644 --- a/executable_semantics/testdata/basic_syntax/zero.carbon +++ b/explorer/testdata/basic_syntax/zero.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { return 0; diff --git a/executable_semantics/testdata/block/empty.carbon b/explorer/testdata/block/empty.carbon similarity index 70% rename from executable_semantics/testdata/block/empty.carbon rename to explorer/testdata/block/empty.carbon index f182c2eaa2a3..b10b299358bc 100644 --- a/executable_semantics/testdata/block/empty.carbon +++ b/explorer/testdata/block/empty.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn DoNothing() { // Empty block diff --git a/executable_semantics/testdata/block/shadowing.carbon b/explorer/testdata/block/shadowing.carbon similarity index 69% rename from executable_semantics/testdata/block/shadowing.carbon rename to explorer/testdata/block/shadowing.carbon index a7279d59f4ef..a45a96dbf880 100644 --- a/executable_semantics/testdata/block/shadowing.carbon +++ b/explorer/testdata/block/shadowing.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 0; diff --git a/executable_semantics/testdata/class/assign.carbon b/explorer/testdata/class/assign.carbon similarity index 72% rename from executable_semantics/testdata/class/assign.carbon rename to explorer/testdata/class/assign.carbon index 304827650500..fad9ea710496 100644 --- a/executable_semantics/testdata/class/assign.carbon +++ b/explorer/testdata/class/assign.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/assign_member.carbon b/explorer/testdata/class/assign_member.carbon similarity index 72% rename from executable_semantics/testdata/class/assign_member.carbon rename to explorer/testdata/class/assign_member.carbon index 91379af5fc99..e1d73002897c 100644 --- a/executable_semantics/testdata/class/assign_member.carbon +++ b/explorer/testdata/class/assign_member.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/bound_method.carbon b/explorer/testdata/class/bound_method.carbon similarity index 75% rename from executable_semantics/testdata/class/bound_method.carbon rename to explorer/testdata/class/bound_method.carbon index 33066a64d973..0d73ebed84eb 100644 --- a/executable_semantics/testdata/class/bound_method.carbon +++ b/explorer/testdata/class/bound_method.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/class/class_function.carbon b/explorer/testdata/class/class_function.carbon similarity index 73% rename from executable_semantics/testdata/class/class_function.carbon rename to explorer/testdata/class/class_function.carbon index 9e8916788d3b..c5a813c38988 100644 --- a/executable_semantics/testdata/class/class_function.carbon +++ b/explorer/testdata/class/class_function.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/class/class_function_from_instance.carbon b/explorer/testdata/class/class_function_from_instance.carbon similarity index 73% rename from executable_semantics/testdata/class/class_function_from_instance.carbon rename to explorer/testdata/class/class_function_from_instance.carbon index 0acb8b4911d9..db21ba27d4db 100644 --- a/executable_semantics/testdata/class/class_function_from_instance.carbon +++ b/explorer/testdata/class/class_function_from_instance.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/class/class_function_value.carbon b/explorer/testdata/class/class_function_value.carbon similarity index 73% rename from executable_semantics/testdata/class/class_function_value.carbon rename to explorer/testdata/class/class_function_value.carbon index 051ea4b90d85..15d70cf5d569 100644 --- a/executable_semantics/testdata/class/class_function_value.carbon +++ b/explorer/testdata/class/class_function_value.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/class/fail_field_access_mismatch.carbon b/explorer/testdata/class/fail_field_access_mismatch.carbon similarity index 55% rename from executable_semantics/testdata/class/fail_field_access_mismatch.carbon rename to explorer/testdata/class/fail_field_access_mismatch.carbon index 9d85f79c45c6..6fa9df6509d1 100644 --- a/executable_semantics/testdata/class/fail_field_access_mismatch.carbon +++ b/explorer/testdata/class/fail_field_access_mismatch.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/class/fail_field_access_mismatch.carbon:21: class Point does not have a field named z +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/class/fail_field_access_mismatch.carbon:21: class Point does not have a field named z -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/fail_field_mismatch.carbon b/explorer/testdata/class/fail_field_mismatch.carbon similarity index 52% rename from executable_semantics/testdata/class/fail_field_mismatch.carbon rename to explorer/testdata/class/fail_field_mismatch.carbon index 320b907fcbe5..32d41ed471da 100644 --- a/executable_semantics/testdata/class/fail_field_mismatch.carbon +++ b/explorer/testdata/class/fail_field_mismatch.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/class/fail_field_mismatch.carbon:20: type error in name binding: '{.x: i32, .z: i32}' is not implicitly convertible to 'class Point' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/class/fail_field_mismatch.carbon:20: type error in name binding: '{.x: i32, .z: i32}' is not implicitly convertible to 'class Point' -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/fail_field_missing.carbon b/explorer/testdata/class/fail_field_missing.carbon similarity index 53% rename from executable_semantics/testdata/class/fail_field_missing.carbon rename to explorer/testdata/class/fail_field_missing.carbon index 0ed4b0d3d6cd..c5c4a8b01ada 100644 --- a/executable_semantics/testdata/class/fail_field_missing.carbon +++ b/explorer/testdata/class/fail_field_missing.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/class/fail_field_missing.carbon:20: type error in name binding: '{.x: i32}' is not implicitly convertible to 'class Point' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/class/fail_field_missing.carbon:20: type error in name binding: '{.x: i32}' is not implicitly convertible to 'class Point' -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/fail_method_from_class.carbon b/explorer/testdata/class/fail_method_from_class.carbon similarity index 61% rename from executable_semantics/testdata/class/fail_method_from_class.carbon rename to explorer/testdata/class/fail_method_from_class.carbon index bcedd282c1ff..916a435a70fe 100644 --- a/executable_semantics/testdata/class/fail_method_from_class.carbon +++ b/explorer/testdata/class/fail_method_from_class.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/class/fail_method_from_class.carbon:28: GetX is not a class function +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/class/fail_method_from_class.carbon:28: GetX is not a class function -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/class/function_param.carbon b/explorer/testdata/class/function_param.carbon similarity index 72% rename from executable_semantics/testdata/class/function_param.carbon rename to explorer/testdata/class/function_param.carbon index 8e3020365560..12c66fbbe0ba 100644 --- a/executable_semantics/testdata/class/function_param.carbon +++ b/explorer/testdata/class/function_param.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/global_var.carbon b/explorer/testdata/class/global_var.carbon similarity index 71% rename from executable_semantics/testdata/class/global_var.carbon rename to explorer/testdata/class/global_var.carbon index 788a3e7b7f3e..7ba15504f2d8 100644 --- a/executable_semantics/testdata/class/global_var.carbon +++ b/explorer/testdata/class/global_var.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/method.carbon b/explorer/testdata/class/method.carbon similarity index 75% rename from executable_semantics/testdata/class/method.carbon rename to explorer/testdata/class/method.carbon index 214a3388f957..64871158213b 100644 --- a/executable_semantics/testdata/class/method.carbon +++ b/explorer/testdata/class/method.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/class/method_call_method.carbon b/explorer/testdata/class/method_call_method.carbon similarity index 77% rename from executable_semantics/testdata/class/method_call_method.carbon rename to explorer/testdata/class/method_call_method.carbon index e9ca71abe1bf..dd72eb81846e 100644 --- a/executable_semantics/testdata/class/method_call_method.carbon +++ b/explorer/testdata/class/method_call_method.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/class/temp.carbon b/explorer/testdata/class/temp.carbon similarity index 72% rename from executable_semantics/testdata/class/temp.carbon rename to explorer/testdata/class/temp.carbon index 8050697d2a3c..d64a203c561c 100644 --- a/executable_semantics/testdata/class/temp.carbon +++ b/explorer/testdata/class/temp.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/class/var.carbon b/explorer/testdata/class/var.carbon similarity index 71% rename from executable_semantics/testdata/class/var.carbon rename to explorer/testdata/class/var.carbon index e0267091c576..ab70055f5f9f 100644 --- a/executable_semantics/testdata/class/var.carbon +++ b/explorer/testdata/class/var.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { var x: i32; diff --git a/executable_semantics/testdata/experimental_continuation/await_maintains_scope.carbon b/explorer/testdata/experimental_continuation/await_maintains_scope.carbon similarity index 75% rename from executable_semantics/testdata/experimental_continuation/await_maintains_scope.carbon rename to explorer/testdata/experimental_continuation/await_maintains_scope.carbon index a379598325eb..e643268b1f20 100644 --- a/executable_semantics/testdata/experimental_continuation/await_maintains_scope.carbon +++ b/explorer/testdata/experimental_continuation/await_maintains_scope.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 3 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test access to block-scoped variables upon resuming a continuation. diff --git a/executable_semantics/testdata/experimental_continuation/creation_is_noop.carbon b/explorer/testdata/experimental_continuation/creation_is_noop.carbon similarity index 72% rename from executable_semantics/testdata/experimental_continuation/creation_is_noop.carbon rename to explorer/testdata/experimental_continuation/creation_is_noop.carbon index 1bfd0cb28164..6ef28af2af34 100644 --- a/executable_semantics/testdata/experimental_continuation/creation_is_noop.carbon +++ b/explorer/testdata/experimental_continuation/creation_is_noop.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test that creating a continuation doesn't do anything. diff --git a/executable_semantics/testdata/experimental_continuation/fail_continuation_syntax.carbon b/explorer/testdata/experimental_continuation/fail_continuation_syntax.carbon similarity index 51% rename from executable_semantics/testdata/experimental_continuation/fail_continuation_syntax.carbon rename to explorer/testdata/experimental_continuation/fail_continuation_syntax.carbon index 8ba8d78b3762..cb2deb0934b4 100644 --- a/executable_semantics/testdata/experimental_continuation/fail_continuation_syntax.carbon +++ b/explorer/testdata/experimental_continuation/fail_continuation_syntax.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/experimental_continuation/fail_continuation_syntax.carbon:16: syntax error, unexpected identifier, expecting LEFT_CURLY_BRACE +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/experimental_continuation/fail_continuation_syntax.carbon:16: syntax error, unexpected identifier, expecting LEFT_CURLY_BRACE -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 0; diff --git a/executable_semantics/testdata/experimental_continuation/fail_lifetime.carbon b/explorer/testdata/experimental_continuation/fail_lifetime.carbon similarity index 67% rename from executable_semantics/testdata/experimental_continuation/fail_lifetime.carbon rename to explorer/testdata/experimental_continuation/fail_lifetime.carbon index 4eb697229286..c948adbdcc96 100644 --- a/executable_semantics/testdata/experimental_continuation/fail_lifetime.carbon +++ b/explorer/testdata/experimental_continuation/fail_lifetime.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: RUNTIME ERROR: {{.*}}/executable_semantics/testdata/experimental_continuation/fail_lifetime.carbon:21: undefined behavior: access to dead value 1 +// AUTOUPDATE: %{explorer} %s +// CHECK: RUNTIME ERROR: {{.*}}/explorer/testdata/experimental_continuation/fail_lifetime.carbon:21: undefined behavior: access to dead value 1 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test that the read from x triggers an error because x is dead. // This test also demonstrates how by-reference free-variable capture diff --git a/executable_semantics/testdata/experimental_continuation/recursive.carbon b/explorer/testdata/experimental_continuation/recursive.carbon similarity index 80% rename from executable_semantics/testdata/experimental_continuation/recursive.carbon rename to explorer/testdata/experimental_continuation/recursive.carbon index 09767f305523..630a60c6339c 100644 --- a/executable_semantics/testdata/experimental_continuation/recursive.carbon +++ b/explorer/testdata/experimental_continuation/recursive.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 10 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test recursive functions inside continuations. diff --git a/executable_semantics/testdata/experimental_continuation/run.carbon b/explorer/testdata/experimental_continuation/run.carbon similarity index 72% rename from executable_semantics/testdata/experimental_continuation/run.carbon rename to explorer/testdata/experimental_continuation/run.carbon index 2563af31f867..f0eda1f87530 100644 --- a/executable_semantics/testdata/experimental_continuation/run.carbon +++ b/explorer/testdata/experimental_continuation/run.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 1 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test creating and running a continuation. diff --git a/executable_semantics/testdata/experimental_continuation/run_with_await.carbon b/explorer/testdata/experimental_continuation/run_with_await.carbon similarity index 74% rename from executable_semantics/testdata/experimental_continuation/run_with_await.carbon rename to explorer/testdata/experimental_continuation/run_with_await.carbon index c4518b78cd0f..432bc60577a8 100644 --- a/executable_semantics/testdata/experimental_continuation/run_with_await.carbon +++ b/explorer/testdata/experimental_continuation/run_with_await.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 3 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test pausing a continuation with `__await` and restarting it with // `__run`. diff --git a/executable_semantics/testdata/experimental_continuation/shallow_copy.carbon b/explorer/testdata/experimental_continuation/shallow_copy.carbon similarity index 76% rename from executable_semantics/testdata/experimental_continuation/shallow_copy.carbon rename to explorer/testdata/experimental_continuation/shallow_copy.carbon index 6b1a2f40afc7..8383bba399ec 100644 --- a/executable_semantics/testdata/experimental_continuation/shallow_copy.carbon +++ b/explorer/testdata/experimental_continuation/shallow_copy.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 3 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Assignment for continuations is shallow, so `k2` refers to the same // continuation as `k1`. diff --git a/executable_semantics/testdata/function/auto_return/add.carbon b/explorer/testdata/function/auto_return/add.carbon similarity index 69% rename from executable_semantics/testdata/function/auto_return/add.carbon rename to explorer/testdata/function/auto_return/add.carbon index 59e89c900445..7eec2391c41d 100644 --- a/executable_semantics/testdata/function/auto_return/add.carbon +++ b/explorer/testdata/function/auto_return/add.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn add(x: i32, y: i32) -> auto { return x + y; } diff --git a/executable_semantics/testdata/function/auto_return/fail_direct_recurse.carbon b/explorer/testdata/function/auto_return/fail_direct_recurse.carbon similarity index 60% rename from executable_semantics/testdata/function/auto_return/fail_direct_recurse.carbon rename to explorer/testdata/function/auto_return/fail_direct_recurse.carbon index 846d7465a856..d84e64034ea4 100644 --- a/executable_semantics/testdata/function/auto_return/fail_direct_recurse.carbon +++ b/explorer/testdata/function/auto_return/fail_direct_recurse.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/auto_return/fail_direct_recurse.carbon:18: Function calls itself, but has a deduced return type +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/auto_return/fail_direct_recurse.carbon:18: Function calls itself, but has a deduced return type -package ExecutableSemanticsTest api; +package ExplorerTest api; // This is required to fail even though the Recurse() call's return value isn't // used. diff --git a/executable_semantics/testdata/function/auto_return/fail_multiple_returns.carbon b/explorer/testdata/function/auto_return/fail_multiple_returns.carbon similarity index 56% rename from executable_semantics/testdata/function/auto_return/fail_multiple_returns.carbon rename to explorer/testdata/function/auto_return/fail_multiple_returns.carbon index 91661622d966..dad80f052f5e 100644 --- a/executable_semantics/testdata/function/auto_return/fail_multiple_returns.carbon +++ b/explorer/testdata/function/auto_return/fail_multiple_returns.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/auto_return/fail_multiple_returns.carbon:18: Only one return is allowed in a function with an `auto` return type. +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/auto_return/fail_multiple_returns.carbon:18: Only one return is allowed in a function with an `auto` return type. -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Add(x: i32, y: i32) -> auto { if (x == 0) { diff --git a/explorer/testdata/function/auto_return/fail_no_return.carbon b/explorer/testdata/function/auto_return/fail_no_return.carbon new file mode 100644 index 000000000000..0940525b457e --- /dev/null +++ b/explorer/testdata/function/auto_return/fail_no_return.carbon @@ -0,0 +1,19 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/auto_return/fail_no_return.carbon:15: control-flow reaches end of function that provides a `->` return type without reaching a return statement + +package ExplorerTest api; + +fn NoReturn() -> auto { +} + +fn Main() { + NoReturn(); +} diff --git a/executable_semantics/testdata/function/auto_return/fail_separate_decl.carbon b/explorer/testdata/function/auto_return/fail_separate_decl.carbon similarity index 54% rename from executable_semantics/testdata/function/auto_return/fail_separate_decl.carbon rename to explorer/testdata/function/auto_return/fail_separate_decl.carbon index 5095060e41ea..f5947ae4d26e 100644 --- a/executable_semantics/testdata/function/auto_return/fail_separate_decl.carbon +++ b/explorer/testdata/function/auto_return/fail_separate_decl.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/auto_return/fail_separate_decl.carbon:15: Function declaration has deduced return type but no body +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/auto_return/fail_separate_decl.carbon:15: Function declaration has deduced return type but no body -package ExecutableSemanticsTest api; +package ExplorerTest api; // This declaration is not allowed. fn Add(x: i32, y: i32) -> auto; diff --git a/executable_semantics/testdata/function/auto_return/modify_arg_type.carbon b/explorer/testdata/function/auto_return/modify_arg_type.carbon similarity index 72% rename from executable_semantics/testdata/function/auto_return/modify_arg_type.carbon rename to explorer/testdata/function/auto_return/modify_arg_type.carbon index f344a053a3d8..71add53cea84 100644 --- a/executable_semantics/testdata/function/auto_return/modify_arg_type.carbon +++ b/explorer/testdata/function/auto_return/modify_arg_type.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Id(t: Type) -> auto { return t; } diff --git a/executable_semantics/testdata/function/auto_return/modify_return_type.carbon b/explorer/testdata/function/auto_return/modify_return_type.carbon similarity index 71% rename from executable_semantics/testdata/function/auto_return/modify_return_type.carbon rename to explorer/testdata/function/auto_return/modify_return_type.carbon index c74245f8c15e..8d01bc3e114d 100644 --- a/executable_semantics/testdata/function/auto_return/modify_return_type.carbon +++ b/explorer/testdata/function/auto_return/modify_return_type.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Id(t: Type) -> auto { return t; } diff --git a/executable_semantics/testdata/function/auto_return/type.carbon b/explorer/testdata/function/auto_return/type.carbon similarity index 72% rename from executable_semantics/testdata/function/auto_return/type.carbon rename to explorer/testdata/function/auto_return/type.carbon index 6bf6f2155a9e..7477746b4f96 100644 --- a/executable_semantics/testdata/function/auto_return/type.carbon +++ b/explorer/testdata/function/auto_return/type.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Id(t: Type) -> auto { return t; } diff --git a/executable_semantics/testdata/function/empty_params.carbon b/explorer/testdata/function/empty_params.carbon similarity index 69% rename from executable_semantics/testdata/function/empty_params.carbon rename to explorer/testdata/function/empty_params.carbon index 159a0b1b1986..a8362e9427be 100644 --- a/executable_semantics/testdata/function/empty_params.carbon +++ b/explorer/testdata/function/empty_params.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test empty parameters and return type fn f() { } diff --git a/executable_semantics/testdata/function/fail_call_with_tuple.carbon b/explorer/testdata/function/fail_call_with_tuple.carbon similarity index 54% rename from executable_semantics/testdata/function/fail_call_with_tuple.carbon rename to explorer/testdata/function/fail_call_with_tuple.carbon index 23fc1a9fcb3e..6bb8b732214e 100644 --- a/executable_semantics/testdata/function/fail_call_with_tuple.carbon +++ b/explorer/testdata/function/fail_call_with_tuple.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/fail_call_with_tuple.carbon:19: type error in call: '((i32, i32))' is not implicitly convertible to '(i32, i32)' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_call_with_tuple.carbon:19: type error in call: '((i32, i32))' is not implicitly convertible to '(i32, i32)' -package ExecutableSemanticsTest api; +package ExplorerTest api; fn f(x: i32, y: i32) -> i32 { return x + y; } diff --git a/executable_semantics/testdata/function/fail_match_no_return.carbon b/explorer/testdata/function/fail_match_no_return.carbon similarity index 51% rename from executable_semantics/testdata/function/fail_match_no_return.carbon rename to explorer/testdata/function/fail_match_no_return.carbon index 04aff240c255..41016bdf5648 100644 --- a/executable_semantics/testdata/function/fail_match_no_return.carbon +++ b/explorer/testdata/function/fail_match_no_return.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/fail_match_no_return.carbon:17: control-flow reaches end of function that provides a `->` return type without reaching a return statement +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_match_no_return.carbon:17: control-flow reaches end of function that provides a `->` return type without reaching a return statement -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 0; diff --git a/executable_semantics/testdata/function/fail_match_partial_return.carbon b/explorer/testdata/function/fail_match_partial_return.carbon similarity index 51% rename from executable_semantics/testdata/function/fail_match_partial_return.carbon rename to explorer/testdata/function/fail_match_partial_return.carbon index 493be23cd083..cf1c67874f94 100644 --- a/executable_semantics/testdata/function/fail_match_partial_return.carbon +++ b/explorer/testdata/function/fail_match_partial_return.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/fail_match_partial_return.carbon:17: control-flow reaches end of function that provides a `->` return type without reaching a return statement +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_match_partial_return.carbon:17: control-flow reaches end of function that provides a `->` return type without reaching a return statement -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 0; diff --git a/explorer/testdata/function/fail_non_exhaustive_match.carbon b/explorer/testdata/function/fail_non_exhaustive_match.carbon new file mode 100644 index 000000000000..f1ef9cc63107 --- /dev/null +++ b/explorer/testdata/function/fail_non_exhaustive_match.carbon @@ -0,0 +1,18 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_non_exhaustive_match.carbon:18: non-exhaustive match may allow control-flow to reach the end of a function that provides a `->` return type + +package ExplorerTest api; + +fn Main() -> i32 { + match (0) { + case 1 => return 0; + } +} diff --git a/executable_semantics/testdata/function/fail_parameter_type.carbon b/explorer/testdata/function/fail_parameter_type.carbon similarity index 57% rename from executable_semantics/testdata/function/fail_parameter_type.carbon rename to explorer/testdata/function/fail_parameter_type.carbon index 8dbb785c8877..08a1f5cbcbb7 100644 --- a/executable_semantics/testdata/function/fail_parameter_type.carbon +++ b/explorer/testdata/function/fail_parameter_type.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/fail_parameter_type.carbon:15: Expected a type, but got 42 +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_parameter_type.carbon:15: Expected a type, but got 42 -package ExecutableSemanticsTest api; +package ExplorerTest api; // 42 cannot be used as the type of a parameter. fn f(x: 42) -> i32 { diff --git a/executable_semantics/testdata/function/fnty.carbon b/explorer/testdata/function/fnty.carbon similarity index 70% rename from executable_semantics/testdata/function/fnty.carbon rename to explorer/testdata/function/fnty.carbon index b149712194fe..11237cf40892 100644 --- a/executable_semantics/testdata/function/fnty.carbon +++ b/explorer/testdata/function/fnty.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn add1(x: i32) -> i32 { return x + 1; diff --git a/executable_semantics/testdata/function/ignored_parameter.carbon b/explorer/testdata/function/ignored_parameter.carbon similarity index 70% rename from executable_semantics/testdata/function/ignored_parameter.carbon rename to explorer/testdata/function/ignored_parameter.carbon index 4f1ae30fbdf3..599b745ff80d 100644 --- a/executable_semantics/testdata/function/ignored_parameter.carbon +++ b/explorer/testdata/function/ignored_parameter.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn ReturnSecond(_: i32, x: i32) -> i32 { return x; diff --git a/executable_semantics/testdata/function/multiple_args.carbon b/explorer/testdata/function/multiple_args.carbon similarity index 70% rename from executable_semantics/testdata/function/multiple_args.carbon rename to explorer/testdata/function/multiple_args.carbon index 0f8ebad76a84..fc9f580f3594 100644 --- a/executable_semantics/testdata/function/multiple_args.carbon +++ b/explorer/testdata/function/multiple_args.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test multiple arguments fn f(x: i32, y: i32) -> i32 { diff --git a/executable_semantics/testdata/function/param_lifetime.carbon b/explorer/testdata/function/param_lifetime.carbon similarity index 76% rename from executable_semantics/testdata/function/param_lifetime.carbon rename to explorer/testdata/function/param_lifetime.carbon index dd1095f1bd33..9f284df653b0 100644 --- a/executable_semantics/testdata/function/param_lifetime.carbon +++ b/explorer/testdata/function/param_lifetime.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // This tests the call-by-value aspect of parameter passing. // This makes sure that when the value in `x` dies, diff --git a/executable_semantics/testdata/function/recursive.carbon b/explorer/testdata/function/recursive.carbon similarity index 71% rename from executable_semantics/testdata/function/recursive.carbon rename to explorer/testdata/function/recursive.carbon index 3b50d61b7d45..b1d63a87ad53 100644 --- a/executable_semantics/testdata/function/recursive.carbon +++ b/explorer/testdata/function/recursive.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn f(x: i32) -> i32 { if (x == 0) { diff --git a/executable_semantics/testdata/function/return.carbon b/explorer/testdata/function/return.carbon similarity index 68% rename from executable_semantics/testdata/function/return.carbon rename to explorer/testdata/function/return.carbon index d037e0567bf7..cc2e0c6a98bc 100644 --- a/executable_semantics/testdata/function/return.carbon +++ b/explorer/testdata/function/return.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn f(x: i32) -> i32 { return x - 1; diff --git a/executable_semantics/testdata/function/return_exhaustive_match.carbon b/explorer/testdata/function/return_exhaustive_match.carbon similarity index 71% rename from executable_semantics/testdata/function/return_exhaustive_match.carbon rename to explorer/testdata/function/return_exhaustive_match.carbon index 3c35bde98eb8..4a111de12099 100644 --- a/executable_semantics/testdata/function/return_exhaustive_match.carbon +++ b/explorer/testdata/function/return_exhaustive_match.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 1 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { match (0) { diff --git a/executable_semantics/testdata/function/type_match.carbon b/explorer/testdata/function/type_match.carbon similarity index 70% rename from executable_semantics/testdata/function/type_match.carbon rename to explorer/testdata/function/type_match.carbon index ef963c7cf186..28401b16a5c5 100644 --- a/executable_semantics/testdata/function/type_match.carbon +++ b/explorer/testdata/function/type_match.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t: (auto, (i32, i32)) = ((1, 2), (3, 4)); diff --git a/executable_semantics/testdata/generic_class/class_function.carbon b/explorer/testdata/generic_class/class_function.carbon similarity index 82% rename from executable_semantics/testdata/generic_class/class_function.carbon rename to explorer/testdata/generic_class/class_function.carbon index 6a29152d6314..49017109bf7b 100644 --- a/executable_semantics/testdata/generic_class/class_function.carbon +++ b/explorer/testdata/generic_class/class_function.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Number { fn Zero() -> Self; diff --git a/executable_semantics/testdata/generic_class/fail_args_mismatch.carbon b/explorer/testdata/generic_class/fail_args_mismatch.carbon similarity index 66% rename from executable_semantics/testdata/generic_class/fail_args_mismatch.carbon rename to explorer/testdata/generic_class/fail_args_mismatch.carbon index 86706cf08ff8..5aa4743552fe 100644 --- a/executable_semantics/testdata/generic_class/fail_args_mismatch.carbon +++ b/explorer/testdata/generic_class/fail_args_mismatch.carbon @@ -2,12 +2,12 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false --dump-input=always -v %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_args_mismatch.carbon:14: type error in call: '(Type, Type)' is not implicitly convertible to '(Type)' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_args_mismatch.carbon:14: type error in call: '(Type, Type)' is not implicitly convertible to '(Type)' -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! Type) { // Point(T, T) does not match class declaration diff --git a/executable_semantics/testdata/generic_class/fail_argument_deduction.carbon b/explorer/testdata/generic_class/fail_argument_deduction.carbon similarity index 65% rename from executable_semantics/testdata/generic_class/fail_argument_deduction.carbon rename to explorer/testdata/generic_class/fail_argument_deduction.carbon index 33966b853f5d..ee4e57a1574d 100644 --- a/executable_semantics/testdata/generic_class/fail_argument_deduction.carbon +++ b/explorer/testdata/generic_class/fail_argument_deduction.carbon @@ -2,16 +2,16 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_argument_deduction.carbon:28: type error in argument deduction +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_argument_deduction.carbon:28: type error in argument deduction // CHECK: expected: i32 // CHECK: actual: Bool -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! Type) { var x: T; diff --git a/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon b/explorer/testdata/generic_class/fail_bad_parameter_type.carbon similarity index 60% rename from executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon rename to explorer/testdata/generic_class/fail_bad_parameter_type.carbon index 4b148e0f9d0f..0a731d29494f 100644 --- a/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon +++ b/explorer/testdata/generic_class/fail_bad_parameter_type.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon:28: type error in call: '(Type)' is not implicitly convertible to '(i32)' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_bad_parameter_type.carbon:28: type error in call: '(Type)' is not implicitly convertible to '(i32)' -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! i32) { fn Origin(zero: T) -> Point(T) { diff --git a/executable_semantics/testdata/generic_class/fail_field_access_on_generic.carbon b/explorer/testdata/generic_class/fail_field_access_on_generic.carbon similarity index 52% rename from executable_semantics/testdata/generic_class/fail_field_access_on_generic.carbon rename to explorer/testdata/generic_class/fail_field_access_on_generic.carbon index 576d6b18d26f..1b2570db99c3 100644 --- a/executable_semantics/testdata/generic_class/fail_field_access_on_generic.carbon +++ b/explorer/testdata/generic_class/fail_field_access_on_generic.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_field_access_on_generic.carbon:15: field access, unexpected T:! Type of non-interface type Type in a.x +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_field_access_on_generic.carbon:15: field access, unexpected T:! Type of non-interface type Type in a.x -package ExecutableSemanticsTest api; +package ExplorerTest api; fn BadFieldAccess[T:! Type](a: T) -> T { return a.x; diff --git a/executable_semantics/testdata/generic_class/fail_generic_class_arg.carbon b/explorer/testdata/generic_class/fail_generic_class_arg.carbon similarity index 57% rename from executable_semantics/testdata/generic_class/fail_generic_class_arg.carbon rename to explorer/testdata/generic_class/fail_generic_class_arg.carbon index ee4a2c863475..48d9fdd03344 100644 --- a/executable_semantics/testdata/generic_class/fail_generic_class_arg.carbon +++ b/explorer/testdata/generic_class/fail_generic_class_arg.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_generic_class_arg.carbon:24: type error in call: '(Type, Type)' is not implicitly convertible to '(Type)' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_generic_class_arg.carbon:24: type error in call: '(Type, Type)' is not implicitly convertible to '(Type)' -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! Type) { fn Create(x: T, y: T) -> Point(T) { diff --git a/executable_semantics/testdata/generic_class/fail_generic_in_pattern.carbon b/explorer/testdata/generic_class/fail_generic_in_pattern.carbon similarity index 54% rename from executable_semantics/testdata/generic_class/fail_generic_in_pattern.carbon rename to explorer/testdata/generic_class/fail_generic_in_pattern.carbon index 95f1daf161d0..445c2553c017 100644 --- a/executable_semantics/testdata/generic_class/fail_generic_in_pattern.carbon +++ b/explorer/testdata/generic_class/fail_generic_in_pattern.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_generic_in_pattern.carbon:17: Generic binding may not occur in pattern with expected type: T:! i32 +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_generic_in_pattern.carbon:17: Generic binding may not occur in pattern with expected type: T:! i32 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t: auto = 5; diff --git a/executable_semantics/testdata/generic_class/fail_instantiate_non_generic.carbon b/explorer/testdata/generic_class/fail_instantiate_non_generic.carbon similarity index 57% rename from executable_semantics/testdata/generic_class/fail_instantiate_non_generic.carbon rename to explorer/testdata/generic_class/fail_instantiate_non_generic.carbon index 17e144c3affd..b2981966cfa9 100644 --- a/executable_semantics/testdata/generic_class/fail_instantiate_non_generic.carbon +++ b/explorer/testdata/generic_class/fail_instantiate_non_generic.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_instantiate_non_generic.carbon:23: attempt to instantiate a non-generic class: Point(i32) +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_instantiate_non_generic.carbon:23: attempt to instantiate a non-generic class: Point(i32) -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/generic_class/fail_point_equal.carbon b/explorer/testdata/generic_class/fail_point_equal.carbon similarity index 53% rename from executable_semantics/testdata/generic_class/fail_point_equal.carbon rename to explorer/testdata/generic_class/fail_point_equal.carbon index 9e0bcbe2b211..0276d1a81442 100644 --- a/executable_semantics/testdata/generic_class/fail_point_equal.carbon +++ b/explorer/testdata/generic_class/fail_point_equal.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_point_equal.carbon:21: type error in name binding: 'class Point(T = i32)' is not implicitly convertible to 'class Point(T = Bool)' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_point_equal.carbon:21: type error in name binding: 'class Point(T = i32)' is not implicitly convertible to 'class Point(T = Bool)' -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! Type) { var x: T; diff --git a/executable_semantics/testdata/generic_class/fail_return_type_is_type.carbon b/explorer/testdata/generic_class/fail_return_type_is_type.carbon similarity index 62% rename from executable_semantics/testdata/generic_class/fail_return_type_is_type.carbon rename to explorer/testdata/generic_class/fail_return_type_is_type.carbon index 8563195cdff8..ca3e37f15cb8 100644 --- a/executable_semantics/testdata/generic_class/fail_return_type_is_type.carbon +++ b/explorer/testdata/generic_class/fail_return_type_is_type.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_return_type_is_type.carbon:18: Expected a type, but got class Point +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_return_type_is_type.carbon:18: Expected a type, but got class Point -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! Type) { // The return type should be Point(T). Point by itself is not a type. diff --git a/executable_semantics/testdata/generic_class/fail_two_arg_lists.carbon b/explorer/testdata/generic_class/fail_two_arg_lists.carbon similarity index 60% rename from executable_semantics/testdata/generic_class/fail_two_arg_lists.carbon rename to explorer/testdata/generic_class/fail_two_arg_lists.carbon index b76e8f851a5e..342aecb872ca 100644 --- a/executable_semantics/testdata/generic_class/fail_two_arg_lists.carbon +++ b/explorer/testdata/generic_class/fail_two_arg_lists.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_two_arg_lists.carbon:15: attempt to instantiate an already instantiated generic class: Point(T)(T) +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_two_arg_lists.carbon:15: attempt to instantiate an already instantiated generic class: Point(T)(T) -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! Type) { fn Origin(zero: T) -> Point(T)(T) { diff --git a/executable_semantics/testdata/generic_class/generic_class_substitution.carbon b/explorer/testdata/generic_class/generic_class_substitution.carbon similarity index 81% rename from executable_semantics/testdata/generic_class/generic_class_substitution.carbon rename to explorer/testdata/generic_class/generic_class_substitution.carbon index b261ef260666..bf22c5a61cc3 100644 --- a/executable_semantics/testdata/generic_class/generic_class_substitution.carbon +++ b/explorer/testdata/generic_class/generic_class_substitution.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Number { fn Zero() -> Self; diff --git a/executable_semantics/testdata/generic_class/generic_fun_and_class.carbon b/explorer/testdata/generic_class/generic_fun_and_class.carbon similarity index 83% rename from executable_semantics/testdata/generic_class/generic_fun_and_class.carbon rename to explorer/testdata/generic_class/generic_fun_and_class.carbon index d28cf20a3583..f62ea7a54e2e 100644 --- a/executable_semantics/testdata/generic_class/generic_fun_and_class.carbon +++ b/explorer/testdata/generic_class/generic_fun_and_class.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Number { fn Zero() -> Self; diff --git a/executable_semantics/testdata/generic_class/generic_point.carbon b/explorer/testdata/generic_class/generic_point.carbon similarity index 76% rename from executable_semantics/testdata/generic_class/generic_point.carbon rename to explorer/testdata/generic_class/generic_point.carbon index b7005f44229d..58d39d257aa6 100644 --- a/executable_semantics/testdata/generic_class/generic_point.carbon +++ b/explorer/testdata/generic_class/generic_point.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point(T:! Type) { fn Origin(zero: T) -> Point(T) { diff --git a/executable_semantics/testdata/generic_class/point_with_interface.carbon b/explorer/testdata/generic_class/point_with_interface.carbon similarity index 82% rename from executable_semantics/testdata/generic_class/point_with_interface.carbon rename to explorer/testdata/generic_class/point_with_interface.carbon index 22665a00353b..948cda25954f 100644 --- a/executable_semantics/testdata/generic_class/point_with_interface.carbon +++ b/explorer/testdata/generic_class/point_with_interface.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Number { fn Zero() -> Self; diff --git a/executable_semantics/testdata/generic_function/apply.carbon b/explorer/testdata/generic_function/apply.carbon similarity index 74% rename from executable_semantics/testdata/generic_function/apply.carbon rename to explorer/testdata/generic_function/apply.carbon index b18d23414a9f..1800ecc5dab0 100644 --- a/executable_semantics/testdata/generic_function/apply.carbon +++ b/explorer/testdata/generic_function/apply.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: -2 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn apply[T:! Type, U:! Type](f: __Fn (T) -> U, x: T) -> U { return f(x); diff --git a/executable_semantics/testdata/generic_function/fail_not_addable.carbon b/explorer/testdata/generic_function/fail_not_addable.carbon similarity index 57% rename from executable_semantics/testdata/generic_function/fail_not_addable.carbon rename to explorer/testdata/generic_function/fail_not_addable.carbon index 2c049cadf1cf..45cea88691e0 100644 --- a/executable_semantics/testdata/generic_function/fail_not_addable.carbon +++ b/explorer/testdata/generic_function/fail_not_addable.carbon @@ -2,16 +2,16 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_function/fail_not_addable.carbon:17: type error in addition(1) +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_function/fail_not_addable.carbon:17: type error in addition(1) // CHECK: expected: i32 // CHECK: actual: T:! Type -package ExecutableSemanticsTest api; +package ExplorerTest api; fn id[T:! Type](x: T) -> T { return x + 0; diff --git a/executable_semantics/testdata/generic_function/fail_type_deduction_mismatch.carbon b/explorer/testdata/generic_function/fail_type_deduction_mismatch.carbon similarity index 56% rename from executable_semantics/testdata/generic_function/fail_type_deduction_mismatch.carbon rename to explorer/testdata/generic_function/fail_type_deduction_mismatch.carbon index a13ecd0518ba..04772a56b79e 100644 --- a/executable_semantics/testdata/generic_function/fail_type_deduction_mismatch.carbon +++ b/explorer/testdata/generic_function/fail_type_deduction_mismatch.carbon @@ -2,16 +2,16 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_function/fail_type_deduction_mismatch.carbon:21: type error in argument deduction +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_function/fail_type_deduction_mismatch.carbon:21: type error in argument deduction // CHECK: expected: i32 // CHECK: actual: Bool -package ExecutableSemanticsTest api; +package ExplorerTest api; fn fst[T:! Type](x: T, y: T) -> T { return x; diff --git a/executable_semantics/testdata/generic_function/fail_type_deduction_unused.carbon b/explorer/testdata/generic_function/fail_type_deduction_unused.carbon similarity index 53% rename from executable_semantics/testdata/generic_function/fail_type_deduction_unused.carbon rename to explorer/testdata/generic_function/fail_type_deduction_unused.carbon index 721efdf816bb..f8ce4ddbdd4c 100644 --- a/executable_semantics/testdata/generic_function/fail_type_deduction_unused.carbon +++ b/explorer/testdata/generic_function/fail_type_deduction_unused.carbon @@ -2,15 +2,15 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_function/fail_type_deduction_unused.carbon:20: could not deduce type argument for type parameter T +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_function/fail_type_deduction_unused.carbon:20: could not deduce type argument for type parameter T // CHECK: in id(0) -package ExecutableSemanticsTest api; +package ExplorerTest api; fn id[T:! Type](x: i32) -> i32 { return x; diff --git a/executable_semantics/testdata/generic_function/non_generic_param.carbon b/explorer/testdata/generic_function/non_generic_param.carbon similarity index 69% rename from executable_semantics/testdata/generic_function/non_generic_param.carbon rename to explorer/testdata/generic_function/non_generic_param.carbon index bb42c3d340a2..0c9ae63d3984 100644 --- a/executable_semantics/testdata/generic_function/non_generic_param.carbon +++ b/explorer/testdata/generic_function/non_generic_param.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 1 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn snd[T:! Type](x: i32, y: T) -> T { return y; diff --git a/executable_semantics/testdata/generic_function/return_val.carbon b/explorer/testdata/generic_function/return_val.carbon similarity index 69% rename from executable_semantics/testdata/generic_function/return_val.carbon rename to explorer/testdata/generic_function/return_val.carbon index 8ccc08e98389..123148ead34a 100644 --- a/executable_semantics/testdata/generic_function/return_val.carbon +++ b/explorer/testdata/generic_function/return_val.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn id[T:! Type](x: T) -> T { return x; diff --git a/executable_semantics/testdata/generic_function/swap.carbon b/explorer/testdata/generic_function/swap.carbon similarity index 71% rename from executable_semantics/testdata/generic_function/swap.carbon rename to explorer/testdata/generic_function/swap.carbon index 64dad0520fba..8f341cbde568 100644 --- a/executable_semantics/testdata/generic_function/swap.carbon +++ b/explorer/testdata/generic_function/swap.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn swap[T:! Type, U:! Type](tuple: (T, U)) -> (U, T) { return (tuple[1], tuple[0]); diff --git a/executable_semantics/testdata/generic_function/tuple_map.carbon b/explorer/testdata/generic_function/tuple_map.carbon similarity index 73% rename from executable_semantics/testdata/generic_function/tuple_map.carbon rename to explorer/testdata/generic_function/tuple_map.carbon index fb3032c2a5de..67eed0ae6c3c 100644 --- a/executable_semantics/testdata/generic_function/tuple_map.carbon +++ b/explorer/testdata/generic_function/tuple_map.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 1 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn map[T:! Type](f: __Fn (T) -> T, tuple: (T, T)) -> (T, T) { return (f(tuple[0]), f(tuple[1])); diff --git a/executable_semantics/testdata/generic_function/type_matching.carbon b/explorer/testdata/generic_function/type_matching.carbon similarity index 69% rename from executable_semantics/testdata/generic_function/type_matching.carbon rename to explorer/testdata/generic_function/type_matching.carbon index fac859e055a3..1955a3457eb8 100644 --- a/executable_semantics/testdata/generic_function/type_matching.carbon +++ b/explorer/testdata/generic_function/type_matching.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn fst[T:! Type](x: T, y: T) -> T { return x; diff --git a/executable_semantics/testdata/global_variable/fail_init_order.carbon b/explorer/testdata/global_variable/fail_init_order.carbon similarity index 59% rename from executable_semantics/testdata/global_variable/fail_init_order.carbon rename to explorer/testdata/global_variable/fail_init_order.carbon index bceedac5c2eb..746d90bf6bf2 100644 --- a/executable_semantics/testdata/global_variable/fail_init_order.carbon +++ b/explorer/testdata/global_variable/fail_init_order.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: RUNTIME ERROR: {{.*}}/executable_semantics/testdata/global_variable/fail_init_order.carbon:17: could not find `y: i32` +// AUTOUPDATE: %{explorer} %s +// CHECK: RUNTIME ERROR: {{.*}}/explorer/testdata/global_variable/fail_init_order.carbon:17: could not find `y: i32` -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test that a global variable may not depend on a later global. // Error expected. diff --git a/executable_semantics/testdata/global_variable/fail_init_type_mismatch.carbon b/explorer/testdata/global_variable/fail_init_type_mismatch.carbon similarity index 52% rename from executable_semantics/testdata/global_variable/fail_init_type_mismatch.carbon rename to explorer/testdata/global_variable/fail_init_type_mismatch.carbon index 350028e493da..1dffc8edd1af 100644 --- a/executable_semantics/testdata/global_variable/fail_init_type_mismatch.carbon +++ b/explorer/testdata/global_variable/fail_init_type_mismatch.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/global_variable/fail_init_type_mismatch.carbon:16: type error in initializer of variable: 'Bool' is not implicitly convertible to 'i32' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/global_variable/fail_init_type_mismatch.carbon:16: type error in initializer of variable: 'Bool' is not implicitly convertible to 'i32' -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test type checking of global variable. Error expected. diff --git a/executable_semantics/testdata/global_variable/init_and_read.carbon b/explorer/testdata/global_variable/init_and_read.carbon similarity index 70% rename from executable_semantics/testdata/global_variable/init_and_read.carbon rename to explorer/testdata/global_variable/init_and_read.carbon index 637cada52ad9..30804c20d65c 100644 --- a/executable_semantics/testdata/global_variable/init_and_read.carbon +++ b/explorer/testdata/global_variable/init_and_read.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test global variable initialization and read. diff --git a/executable_semantics/testdata/global_variable/init_from_function.carbon b/explorer/testdata/global_variable/init_from_function.carbon similarity index 71% rename from executable_semantics/testdata/global_variable/init_from_function.carbon rename to explorer/testdata/global_variable/init_from_function.carbon index 03863ab32263..e60f505a7b89 100644 --- a/executable_semantics/testdata/global_variable/init_from_function.carbon +++ b/explorer/testdata/global_variable/init_from_function.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test a global variable depending on a function. diff --git a/executable_semantics/testdata/global_variable/init_order.carbon b/explorer/testdata/global_variable/init_order.carbon similarity index 71% rename from executable_semantics/testdata/global_variable/init_order.carbon rename to explorer/testdata/global_variable/init_order.carbon index c192d39d8107..3a4fdc20df4e 100644 --- a/executable_semantics/testdata/global_variable/init_order.carbon +++ b/explorer/testdata/global_variable/init_order.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test a global variable depending on another global. diff --git a/executable_semantics/testdata/global_variable/shadowing.carbon b/explorer/testdata/global_variable/shadowing.carbon similarity index 72% rename from executable_semantics/testdata/global_variable/shadowing.carbon rename to explorer/testdata/global_variable/shadowing.carbon index b913f39cdf1a..298d46da8f20 100644 --- a/executable_semantics/testdata/global_variable/shadowing.carbon +++ b/explorer/testdata/global_variable/shadowing.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test overshadowing of global variable. diff --git a/executable_semantics/testdata/global_variable/write.carbon b/explorer/testdata/global_variable/write.carbon similarity index 70% rename from executable_semantics/testdata/global_variable/write.carbon rename to explorer/testdata/global_variable/write.carbon index 9ede8e7fa5a3..3bc97974aeeb 100644 --- a/executable_semantics/testdata/global_variable/write.carbon +++ b/explorer/testdata/global_variable/write.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test mutation of a global variable. diff --git a/executable_semantics/testdata/global_variable/write_from_function.carbon b/explorer/testdata/global_variable/write_from_function.carbon similarity index 73% rename from executable_semantics/testdata/global_variable/write_from_function.carbon rename to explorer/testdata/global_variable/write_from_function.carbon index b4542b2cd0ac..5d3f57c0f27c 100644 --- a/executable_semantics/testdata/global_variable/write_from_function.carbon +++ b/explorer/testdata/global_variable/write_from_function.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test that mutations to a global variable in one function is visible // in another function. diff --git a/executable_semantics/testdata/if_else/if_else.carbon b/explorer/testdata/if_else/if_else.carbon similarity index 69% rename from executable_semantics/testdata/if_else/if_else.carbon rename to explorer/testdata/if_else/if_else.carbon index 3d75c3b32154..de4ac083705b 100644 --- a/executable_semantics/testdata/if_else/if_else.carbon +++ b/explorer/testdata/if_else/if_else.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { if (0 == 1) { diff --git a/executable_semantics/testdata/if_else/if_else_if.carbon b/explorer/testdata/if_else/if_else_if.carbon similarity index 70% rename from executable_semantics/testdata/if_else/if_else_if.carbon rename to explorer/testdata/if_else/if_else_if.carbon index 25d1375dd182..deedbdb84d69 100644 --- a/executable_semantics/testdata/if_else/if_else_if.carbon +++ b/explorer/testdata/if_else/if_else_if.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { if (0 == 1) { diff --git a/executable_semantics/testdata/if_else/if_else_if_else.carbon b/explorer/testdata/if_else/if_else_if_else.carbon similarity index 71% rename from executable_semantics/testdata/if_else/if_else_if_else.carbon rename to explorer/testdata/if_else/if_else_if_else.carbon index dc327a5daa8e..a1db8dcf72b5 100644 --- a/executable_semantics/testdata/if_else/if_else_if_else.carbon +++ b/explorer/testdata/if_else/if_else_if_else.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { if (0 == 1) { diff --git a/executable_semantics/testdata/if_else/if_false.carbon b/explorer/testdata/if_else/if_false.carbon similarity index 68% rename from executable_semantics/testdata/if_else/if_false.carbon rename to explorer/testdata/if_else/if_false.carbon index 31ed21986438..58c0aefaa92c 100644 --- a/executable_semantics/testdata/if_else/if_false.carbon +++ b/explorer/testdata/if_else/if_false.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { if (0 == 1) { diff --git a/executable_semantics/testdata/if_else/if_nesting.carbon b/explorer/testdata/if_else/if_nesting.carbon similarity index 71% rename from executable_semantics/testdata/if_else/if_nesting.carbon rename to explorer/testdata/if_else/if_nesting.carbon index 818d9468a52c..7289aa595310 100644 --- a/executable_semantics/testdata/if_else/if_nesting.carbon +++ b/explorer/testdata/if_else/if_nesting.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { if (0 == 0) { diff --git a/executable_semantics/testdata/if_else/if_true.carbon b/explorer/testdata/if_else/if_true.carbon similarity index 68% rename from executable_semantics/testdata/if_else/if_true.carbon rename to explorer/testdata/if_else/if_true.carbon index 7182768e06d6..fe123a969a66 100644 --- a/executable_semantics/testdata/if_else/if_true.carbon +++ b/explorer/testdata/if_else/if_true.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { if (1 == 1) { diff --git a/executable_semantics/testdata/if_expression/if_then_else.carbon b/explorer/testdata/if_expression/if_then_else.carbon similarity index 77% rename from executable_semantics/testdata/if_expression/if_then_else.carbon rename to explorer/testdata/if_expression/if_then_else.carbon index e25aed2821e7..a95f0fabee2d 100644 --- a/executable_semantics/testdata/if_expression/if_then_else.carbon +++ b/explorer/testdata/if_expression/if_then_else.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 12 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var cond: if true then Bool else i32 = true; diff --git a/executable_semantics/testdata/impl/fail_ambiguous_impl.carbon b/explorer/testdata/impl/fail_ambiguous_impl.carbon similarity index 75% rename from executable_semantics/testdata/impl/fail_ambiguous_impl.carbon rename to explorer/testdata/impl/fail_ambiguous_impl.carbon index 91c41fad8702..ab873d0af064 100644 --- a/executable_semantics/testdata/impl/fail_ambiguous_impl.carbon +++ b/explorer/testdata/impl/fail_ambiguous_impl.carbon @@ -2,15 +2,15 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/impl/fail_ambiguous_impl.carbon:50: ambiguous implementations of interface Vector for class Point +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/impl/fail_ambiguous_impl.carbon:50: ambiguous implementations of interface Vector for class Point -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/impl/impl_as.carbon b/explorer/testdata/impl/fail_impl_as_not_constraint.carbon similarity index 52% rename from executable_semantics/testdata/impl/impl_as.carbon rename to explorer/testdata/impl/fail_impl_as_not_constraint.carbon index 3e8d3fb8055f..1f4b1a90bf68 100644 --- a/executable_semantics/testdata/impl/impl_as.carbon +++ b/explorer/testdata/impl/fail_impl_as_not_constraint.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/impl/impl_as.carbon:14: expected constraint after `as`, found value of type i32 +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/impl/fail_impl_as_not_constraint.carbon:14: expected constraint after `as`, found value of type i32 -package ExecutableSemanticsTest api; +package ExplorerTest api; external impl i32 as i32 {} diff --git a/executable_semantics/testdata/impl/fail_impl_as_parameterized.carbon b/explorer/testdata/impl/fail_impl_as_parameterized.carbon similarity index 54% rename from executable_semantics/testdata/impl/fail_impl_as_parameterized.carbon rename to explorer/testdata/impl/fail_impl_as_parameterized.carbon index a930878b59ff..99e2a60f0cfa 100644 --- a/executable_semantics/testdata/impl/fail_impl_as_parameterized.carbon +++ b/explorer/testdata/impl/fail_impl_as_parameterized.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/impl/fail_impl_as_parameterized.carbon:17: missing arguments for parameterized interface +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/impl/fail_impl_as_parameterized.carbon:17: missing arguments for parameterized interface -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector(Scalar:! Type) { } diff --git a/explorer/testdata/impl/impl_as.carbon b/explorer/testdata/impl/impl_as.carbon new file mode 100644 index 000000000000..53d8652a6d8c --- /dev/null +++ b/explorer/testdata/impl/impl_as.carbon @@ -0,0 +1,17 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/impl/impl_as.carbon:14: expected constraint after `as`, found value of type i32 + +package ExplorerTest api; + +external impl i32 as i32 {} + +fn Main() -> i32 { +} diff --git a/executable_semantics/testdata/impl/param_impl.carbon b/explorer/testdata/impl/param_impl.carbon similarity index 85% rename from executable_semantics/testdata/impl/param_impl.carbon rename to explorer/testdata/impl/param_impl.carbon index 3ac8aa9cd719..4b67ef17c222 100644 --- a/executable_semantics/testdata/impl/param_impl.carbon +++ b/explorer/testdata/impl/param_impl.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Number { fn Zero() -> Self; diff --git a/executable_semantics/testdata/impl/param_impl2.carbon b/explorer/testdata/impl/param_impl2.carbon similarity index 86% rename from executable_semantics/testdata/impl/param_impl2.carbon rename to explorer/testdata/impl/param_impl2.carbon index 86c205969423..26fd213da650 100644 --- a/executable_semantics/testdata/impl/param_impl2.carbon +++ b/explorer/testdata/impl/param_impl2.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Number { fn Zero() -> Self; diff --git a/executable_semantics/testdata/import/fail_nonexistent_library.carbon b/explorer/testdata/import/fail_nonexistent_library.carbon similarity index 70% rename from executable_semantics/testdata/import/fail_nonexistent_library.carbon rename to explorer/testdata/import/fail_nonexistent_library.carbon index 286de2594a9f..a8f74073eee7 100644 --- a/executable_semantics/testdata/import/fail_nonexistent_library.carbon +++ b/explorer/testdata/import/fail_nonexistent_library.carbon @@ -4,14 +4,14 @@ // // TODO: This SHOULD fail but doesn't presently. // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; import Nonexistent; diff --git a/executable_semantics/testdata/import/fail_nonexistent_package.carbon b/explorer/testdata/import/fail_nonexistent_package.carbon similarity index 64% rename from executable_semantics/testdata/import/fail_nonexistent_package.carbon rename to explorer/testdata/import/fail_nonexistent_package.carbon index e2175d47f1c3..15ce18350daf 100644 --- a/executable_semantics/testdata/import/fail_nonexistent_package.carbon +++ b/explorer/testdata/import/fail_nonexistent_package.carbon @@ -4,16 +4,16 @@ // // TODO: This SHOULD fail but doesn't presently. // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; -import ExecutableSemanticsTest library "Nonexistent"; +import ExplorerTest library "Nonexistent"; fn Main() -> i32 { return 0; diff --git a/explorer/testdata/import/fail_order.carbon b/explorer/testdata/import/fail_order.carbon new file mode 100644 index 000000000000..36b80e7f8ed3 --- /dev/null +++ b/explorer/testdata/import/fail_order.carbon @@ -0,0 +1,18 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/import/fail_order.carbon:18: syntax error, unexpected IMPORT, expecting END_OF_FILE + +package ExplorerTest api; + +fn Main() -> i32 { + return 0; +} + +import ExplorerTest library "Nonexistent"; diff --git a/executable_semantics/testdata/interface/class_function.carbon b/explorer/testdata/interface/class_function.carbon similarity index 83% rename from executable_semantics/testdata/interface/class_function.carbon rename to explorer/testdata/interface/class_function.carbon index 6d9127201b02..9a27bc26c43d 100644 --- a/executable_semantics/testdata/interface/class_function.carbon +++ b/explorer/testdata/interface/class_function.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Zero() -> Self; diff --git a/executable_semantics/testdata/interface/constrained_parameter.carbon b/explorer/testdata/interface/constrained_parameter.carbon similarity index 88% rename from executable_semantics/testdata/interface/constrained_parameter.carbon rename to explorer/testdata/interface/constrained_parameter.carbon index 08fd4b77f93b..e6b3a747e590 100644 --- a/executable_semantics/testdata/interface/constrained_parameter.carbon +++ b/explorer/testdata/interface/constrained_parameter.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface AddMul { fn Add[me: Self](o: Self) -> Self; diff --git a/executable_semantics/testdata/interface/external_impl_point_vector.carbon b/explorer/testdata/interface/external_impl_point_vector.carbon similarity index 83% rename from executable_semantics/testdata/interface/external_impl_point_vector.carbon rename to explorer/testdata/interface/external_impl_point_vector.carbon index 168e649803e9..143ad3df2dc2 100644 --- a/executable_semantics/testdata/interface/external_impl_point_vector.carbon +++ b/explorer/testdata/interface/external_impl_point_vector.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/fail_impl_bad_member.carbon b/explorer/testdata/interface/fail_impl_bad_member.carbon similarity index 68% rename from executable_semantics/testdata/interface/fail_impl_bad_member.carbon rename to explorer/testdata/interface/fail_impl_bad_member.carbon index a80465d8915e..4e5cee916cb8 100644 --- a/executable_semantics/testdata/interface/fail_impl_bad_member.carbon +++ b/explorer/testdata/interface/fail_impl_bad_member.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/interface/fail_impl_bad_member.carbon:28: type error in member of implementation: 'fn (i32) -> i32' is not implicitly convertible to 'fn (i32) -> class Point' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_impl_bad_member.carbon:28: type error in member of implementation: 'fn (i32) -> i32' is not implicitly convertible to 'fn (i32) -> class Point' -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/fail_impl_missing_member.carbon b/explorer/testdata/interface/fail_impl_missing_member.carbon similarity index 71% rename from executable_semantics/testdata/interface/fail_impl_missing_member.carbon rename to explorer/testdata/interface/fail_impl_missing_member.carbon index b082e30909b1..0e5c74e7141d 100644 --- a/executable_semantics/testdata/interface/fail_impl_missing_member.carbon +++ b/explorer/testdata/interface/fail_impl_missing_member.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/interface/fail_impl_missing_member.carbon:26: implementation missing Scale +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_impl_missing_member.carbon:26: implementation missing Scale -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/fail_interface_missing_member.carbon b/explorer/testdata/interface/fail_interface_missing_member.carbon similarity index 67% rename from executable_semantics/testdata/interface/fail_interface_missing_member.carbon rename to explorer/testdata/interface/fail_interface_missing_member.carbon index a89be1d0eee8..f51b7908ddc5 100644 --- a/executable_semantics/testdata/interface/fail_interface_missing_member.carbon +++ b/explorer/testdata/interface/fail_interface_missing_member.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/interface/fail_interface_missing_member.carbon:19: field access, Scale not in Vector +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_interface_missing_member.carbon:19: field access, Scale not in Vector -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/fail_no_impl.carbon b/explorer/testdata/interface/fail_no_impl.carbon similarity index 65% rename from executable_semantics/testdata/interface/fail_no_impl.carbon rename to explorer/testdata/interface/fail_no_impl.carbon index 86250b678de5..0ef0ac73025c 100644 --- a/executable_semantics/testdata/interface/fail_no_impl.carbon +++ b/explorer/testdata/interface/fail_no_impl.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/interface/fail_no_impl.carbon:31: could not find implementation of interface Vector for class Point +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_no_impl.carbon:31: could not find implementation of interface Vector for class Point -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/generic_call_generic.carbon b/explorer/testdata/interface/generic_call_generic.carbon similarity index 84% rename from executable_semantics/testdata/interface/generic_call_generic.carbon rename to explorer/testdata/interface/generic_call_generic.carbon index 34ba94208394..9a016f1dbe0f 100644 --- a/executable_semantics/testdata/interface/generic_call_generic.carbon +++ b/explorer/testdata/interface/generic_call_generic.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/generic_with_two_params.carbon b/explorer/testdata/interface/generic_with_two_params.carbon similarity index 87% rename from executable_semantics/testdata/interface/generic_with_two_params.carbon rename to explorer/testdata/interface/generic_with_two_params.carbon index 653e228ff1d8..ac50395ee781 100644 --- a/executable_semantics/testdata/interface/generic_with_two_params.carbon +++ b/explorer/testdata/interface/generic_with_two_params.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/parameterized.carbon b/explorer/testdata/interface/parameterized.carbon similarity index 84% rename from executable_semantics/testdata/interface/parameterized.carbon rename to explorer/testdata/interface/parameterized.carbon index c8549554180f..c66d1cc71652 100644 --- a/executable_semantics/testdata/interface/parameterized.carbon +++ b/explorer/testdata/interface/parameterized.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector(Scalar:! Type) { fn Zero() -> Self; diff --git a/executable_semantics/testdata/interface/tuple_vector_add_scale.carbon b/explorer/testdata/interface/tuple_vector_add_scale.carbon similarity index 83% rename from executable_semantics/testdata/interface/tuple_vector_add_scale.carbon rename to explorer/testdata/interface/tuple_vector_add_scale.carbon index cb48cb545b62..35f6294685f6 100644 --- a/executable_semantics/testdata/interface/tuple_vector_add_scale.carbon +++ b/explorer/testdata/interface/tuple_vector_add_scale.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/interface/vector_point_add_scale.carbon b/explorer/testdata/interface/vector_point_add_scale.carbon similarity index 83% rename from executable_semantics/testdata/interface/vector_point_add_scale.carbon rename to explorer/testdata/interface/vector_point_add_scale.carbon index b028d2452568..961b19c71360 100644 --- a/executable_semantics/testdata/interface/vector_point_add_scale.carbon +++ b/explorer/testdata/interface/vector_point_add_scale.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; interface Vector { fn Add[me: Self](b: Self) -> Self; diff --git a/executable_semantics/testdata/let/fail_function_args.carbon b/explorer/testdata/let/fail_function_args.carbon similarity index 58% rename from executable_semantics/testdata/let/fail_function_args.carbon rename to explorer/testdata/let/fail_function_args.carbon index 6868559e97c3..18e37da0b087 100644 --- a/executable_semantics/testdata/let/fail_function_args.carbon +++ b/explorer/testdata/let/fail_function_args.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_function_args.carbon:16: Cannot assign to rvalue 'y' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_function_args.carbon:16: Cannot assign to rvalue 'y' -package ExecutableSemanticsTest api; +package ExplorerTest api; fn f((var x: i32, y: i32)) -> i32 { x = 0; diff --git a/explorer/testdata/let/fail_global_assign.carbon b/explorer/testdata/let/fail_global_assign.carbon new file mode 100644 index 000000000000..7560f82da10a --- /dev/null +++ b/explorer/testdata/let/fail_global_assign.carbon @@ -0,0 +1,19 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_global_assign.carbon:17: Cannot assign to rvalue 'x' + +package ExplorerTest api; + +let x: i32 = 10; + +fn Main() -> i32 { + x = 0; + return 0; +} diff --git a/explorer/testdata/let/fail_local_assign.carbon b/explorer/testdata/let/fail_local_assign.carbon new file mode 100644 index 000000000000..1297fff45c88 --- /dev/null +++ b/explorer/testdata/let/fail_local_assign.carbon @@ -0,0 +1,18 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_local_assign.carbon:16: Cannot assign to rvalue 'x' + +package ExplorerTest api; + +fn Main() -> i32 { + let x: auto = 10; + x = 0; + return 0; +} diff --git a/executable_semantics/testdata/let/fail_match_choice.carbon b/explorer/testdata/let/fail_match_choice.carbon similarity index 65% rename from executable_semantics/testdata/let/fail_match_choice.carbon rename to explorer/testdata/let/fail_match_choice.carbon index 505020e88339..150c27042aec 100644 --- a/executable_semantics/testdata/let/fail_match_choice.carbon +++ b/explorer/testdata/let/fail_match_choice.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_match_choice.carbon:29: Cannot assign to rvalue 'x' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_match_choice.carbon:29: Cannot assign to rvalue 'x' -package ExecutableSemanticsTest api; +package ExplorerTest api; choice Ints { None, diff --git a/executable_semantics/testdata/let/fail_method_args.carbon b/explorer/testdata/let/fail_method_args.carbon similarity index 62% rename from executable_semantics/testdata/let/fail_method_args.carbon rename to explorer/testdata/let/fail_method_args.carbon index ec153e8cf2dc..d19a83e5d500 100644 --- a/executable_semantics/testdata/let/fail_method_args.carbon +++ b/explorer/testdata/let/fail_method_args.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_method_args.carbon:20: Cannot assign to rvalue 'x' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_method_args.carbon:20: Cannot assign to rvalue 'x' -package ExecutableSemanticsTest api; +package ExplorerTest api; class Point { fn Origin() -> Point { diff --git a/executable_semantics/testdata/let/fail_tuple_pattern_let_context.carbon b/explorer/testdata/let/fail_tuple_pattern_let_context.carbon similarity index 57% rename from executable_semantics/testdata/let/fail_tuple_pattern_let_context.carbon rename to explorer/testdata/let/fail_tuple_pattern_let_context.carbon index 60ad0b692a89..5b0f3abff2cb 100644 --- a/executable_semantics/testdata/let/fail_tuple_pattern_let_context.carbon +++ b/explorer/testdata/let/fail_tuple_pattern_let_context.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_tuple_pattern_let_context.carbon:18: Cannot assign to rvalue 'c' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_tuple_pattern_let_context.carbon:18: Cannot assign to rvalue 'c' -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { let (var a: auto, b: auto, c: auto, d: auto) = (1, 2, 3, 4); diff --git a/executable_semantics/testdata/let/fail_tuple_pattern_let_context_nested.carbon b/explorer/testdata/let/fail_tuple_pattern_let_context_nested.carbon similarity index 56% rename from executable_semantics/testdata/let/fail_tuple_pattern_let_context_nested.carbon rename to explorer/testdata/let/fail_tuple_pattern_let_context_nested.carbon index 719aa1f50c49..bcae1367785f 100644 --- a/executable_semantics/testdata/let/fail_tuple_pattern_let_context_nested.carbon +++ b/explorer/testdata/let/fail_tuple_pattern_let_context_nested.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_tuple_pattern_let_context_nested.carbon:15: syntax error, unexpected LET +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_tuple_pattern_let_context_nested.carbon:15: syntax error, unexpected LET -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { let (var a: auto, b: auto, c: auto, var (d: auto, let e: auto)) = diff --git a/executable_semantics/testdata/let/fail_tuple_pattern_let_in_var.carbon b/explorer/testdata/let/fail_tuple_pattern_let_in_var.carbon similarity index 55% rename from executable_semantics/testdata/let/fail_tuple_pattern_let_in_var.carbon rename to explorer/testdata/let/fail_tuple_pattern_let_in_var.carbon index 82c540b79c61..86925b76dda0 100644 --- a/executable_semantics/testdata/let/fail_tuple_pattern_let_in_var.carbon +++ b/explorer/testdata/let/fail_tuple_pattern_let_in_var.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_tuple_pattern_let_in_var.carbon:15: syntax error, unexpected LET +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/let/fail_tuple_pattern_let_in_var.carbon:15: syntax error, unexpected LET -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var (var a: auto, b: auto, let c: auto, d: auto) = (1, 2, 3, 4); diff --git a/executable_semantics/testdata/let/nested_tuple_pattern.carbon b/explorer/testdata/let/nested_tuple_pattern.carbon similarity index 76% rename from executable_semantics/testdata/let/nested_tuple_pattern.carbon rename to explorer/testdata/let/nested_tuple_pattern.carbon index 35c709ed7cdf..58c9c0259047 100644 --- a/executable_semantics/testdata/let/nested_tuple_pattern.carbon +++ b/explorer/testdata/let/nested_tuple_pattern.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; choice Ints { None, diff --git a/executable_semantics/testdata/lit.cfg.py b/explorer/testdata/lit.cfg.py similarity index 76% rename from executable_semantics/testdata/lit.cfg.py rename to explorer/testdata/lit.cfg.py index 088dd25e8ac0..0f1166f60ee2 100644 --- a/executable_semantics/testdata/lit.cfg.py +++ b/explorer/testdata/lit.cfg.py @@ -21,15 +21,15 @@ config.suffixes = [".carbon"] config.test_format = lit.formats.ShTest() config.substitutions.append( - ("%{prelude}", fullpath("carbon/executable_semantics/data/prelude.carbon")) + ("%{prelude}", fullpath("carbon/explorer/data/prelude.carbon")) ) config.substitutions.append( ( - "%{executable_semantics}", + "%{explorer}", "%s --prelude=%s" % ( - fullpath("carbon/executable_semantics/executable_semantics"), - fullpath("carbon/executable_semantics/data/prelude.carbon"), + fullpath("carbon/explorer/explorer"), + fullpath("carbon/explorer/data/prelude.carbon"), ), ) ) diff --git a/executable_semantics/testdata/match/any_int.carbon b/explorer/testdata/match/any_int.carbon similarity index 69% rename from executable_semantics/testdata/match/any_int.carbon rename to explorer/testdata/match/any_int.carbon index 9f05a7f303a9..28e30f14efed 100644 --- a/executable_semantics/testdata/match/any_int.carbon +++ b/explorer/testdata/match/any_int.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t: auto = 5; diff --git a/executable_semantics/testdata/match/int.carbon b/explorer/testdata/match/int.carbon similarity index 70% rename from executable_semantics/testdata/match/int.carbon rename to explorer/testdata/match/int.carbon index 88dbe28ab22b..fb03242b5cdb 100644 --- a/executable_semantics/testdata/match/int.carbon +++ b/explorer/testdata/match/int.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t: auto = 5; diff --git a/executable_semantics/testdata/match/int_default.carbon b/explorer/testdata/match/int_default.carbon similarity index 72% rename from executable_semantics/testdata/match/int_default.carbon rename to explorer/testdata/match/int_default.carbon index 929b28b0c63f..472ef1f0372d 100644 --- a/executable_semantics/testdata/match/int_default.carbon +++ b/explorer/testdata/match/int_default.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t: auto = 5; diff --git a/executable_semantics/testdata/match/no_match.carbon b/explorer/testdata/match/no_match.carbon similarity index 70% rename from executable_semantics/testdata/match/no_match.carbon rename to explorer/testdata/match/no_match.carbon index 0ac8385cc520..20c39aea104b 100644 --- a/executable_semantics/testdata/match/no_match.carbon +++ b/explorer/testdata/match/no_match.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 0; diff --git a/executable_semantics/testdata/match/placeholder.carbon b/explorer/testdata/match/placeholder.carbon similarity index 72% rename from executable_semantics/testdata/match/placeholder.carbon rename to explorer/testdata/match/placeholder.carbon index 5b06ef03aef0..d0d31f20de19 100644 --- a/executable_semantics/testdata/match/placeholder.carbon +++ b/explorer/testdata/match/placeholder.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t: auto = (1, 2, 3, 4); diff --git a/executable_semantics/testdata/name_lookup/fail_use_before_declare.carbon b/explorer/testdata/name_lookup/fail_block_duplicate.carbon similarity index 50% rename from executable_semantics/testdata/name_lookup/fail_use_before_declare.carbon rename to explorer/testdata/name_lookup/fail_block_duplicate.carbon index 6f04e6867c32..05fea016141c 100644 --- a/executable_semantics/testdata/name_lookup/fail_use_before_declare.carbon +++ b/explorer/testdata/name_lookup/fail_block_duplicate.carbon @@ -2,17 +2,17 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/name_lookup/fail_use_before_declare.carbon:15: could not resolve 'x' +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/name_lookup/fail_block_duplicate.carbon:16: Duplicate name `x` also found at {{.*}}/explorer/testdata/name_lookup/fail_block_duplicate.carbon:15 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { - x = 0; + var x: i32 = 0; var x: i32 = 0; return 0; } diff --git a/explorer/testdata/name_lookup/fail_choice_duplicate.carbon b/explorer/testdata/name_lookup/fail_choice_duplicate.carbon new file mode 100644 index 000000000000..3d53b8f59c2c --- /dev/null +++ b/explorer/testdata/name_lookup/fail_choice_duplicate.carbon @@ -0,0 +1,21 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/name_lookup/fail_choice_duplicate.carbon:16: Duplicate name `None` in choice type + +package ExplorerTest api; + +choice Ints { + None, + None, +} + +fn Main() -> i32 { + return 0; +} diff --git a/explorer/testdata/name_lookup/fail_class_duplicate.carbon b/explorer/testdata/name_lookup/fail_class_duplicate.carbon new file mode 100644 index 000000000000..7869a55038ba --- /dev/null +++ b/explorer/testdata/name_lookup/fail_class_duplicate.carbon @@ -0,0 +1,21 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/name_lookup/fail_class_duplicate.carbon:16: Duplicate name `x` also found at {{.*}}/explorer/testdata/name_lookup/fail_class_duplicate.carbon:15 + +package ExplorerTest api; + +class Foo { + var x: i32; + var x: i32; +} + +fn Main() -> i32 { + return 0; +} diff --git a/explorer/testdata/name_lookup/fail_global_duplicate.carbon b/explorer/testdata/name_lookup/fail_global_duplicate.carbon new file mode 100644 index 000000000000..ffdc84e31208 --- /dev/null +++ b/explorer/testdata/name_lookup/fail_global_duplicate.carbon @@ -0,0 +1,19 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/name_lookup/fail_global_duplicate.carbon:15: Duplicate name `x` also found at {{.*}}/explorer/testdata/name_lookup/fail_global_duplicate.carbon:14 + +package ExplorerTest api; + +var x: i32 = 0; +var x: i32 = 0; + +fn Main() -> i32 { + return 0; +} diff --git a/explorer/testdata/name_lookup/fail_match_duplicate.carbon b/explorer/testdata/name_lookup/fail_match_duplicate.carbon new file mode 100644 index 000000000000..694fa3ad8d88 --- /dev/null +++ b/explorer/testdata/name_lookup/fail_match_duplicate.carbon @@ -0,0 +1,20 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/name_lookup/fail_match_duplicate.carbon:17: Duplicate name `x` also found at {{.*}}/explorer/testdata/name_lookup/fail_match_duplicate.carbon:16 + +package ExplorerTest api; + +fn Main() -> i32 { + match (0) { + case x: i32 => + var x: i32 = 0; + } + return 0; +} diff --git a/explorer/testdata/name_lookup/fail_use_before_declare.carbon b/explorer/testdata/name_lookup/fail_use_before_declare.carbon new file mode 100644 index 000000000000..309f11914567 --- /dev/null +++ b/explorer/testdata/name_lookup/fail_use_before_declare.carbon @@ -0,0 +1,18 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/name_lookup/fail_use_before_declare.carbon:15: could not resolve 'x' + +package ExplorerTest api; + +fn Main() -> i32 { + x = 0; + var x: i32 = 0; + return 0; +} diff --git a/executable_semantics/testdata/name_lookup/global_shadow.carbon b/explorer/testdata/name_lookup/global_shadow.carbon similarity index 68% rename from executable_semantics/testdata/name_lookup/global_shadow.carbon rename to explorer/testdata/name_lookup/global_shadow.carbon index 81ca51152447..aebe34d86ff6 100644 --- a/executable_semantics/testdata/name_lookup/global_shadow.carbon +++ b/explorer/testdata/name_lookup/global_shadow.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; var x: i32 = 0; diff --git a/executable_semantics/testdata/name_lookup/match_shadow.carbon b/explorer/testdata/name_lookup/match_shadow.carbon similarity index 70% rename from executable_semantics/testdata/name_lookup/match_shadow.carbon rename to explorer/testdata/name_lookup/match_shadow.carbon index b3e584b9238d..bf2c75dbef2e 100644 --- a/executable_semantics/testdata/name_lookup/match_shadow.carbon +++ b/explorer/testdata/name_lookup/match_shadow.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; var x: i32 = 0; diff --git a/explorer/testdata/package/fail_missing.carbon b/explorer/testdata/package/fail_missing.carbon new file mode 100644 index 000000000000..fa4cd4f2785c --- /dev/null +++ b/explorer/testdata/package/fail_missing.carbon @@ -0,0 +1,14 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/package/fail_missing.carbon:12: syntax error, unexpected FN, expecting PACKAGE + +fn Main() -> i32 { + return 0; +} diff --git a/executable_semantics/testdata/package/with_library.carbon b/explorer/testdata/package/with_library.carbon similarity index 65% rename from executable_semantics/testdata/package/with_library.carbon rename to explorer/testdata/package/with_library.carbon index a95448bd54d9..f24aebab425e 100644 --- a/executable_semantics/testdata/package/with_library.carbon +++ b/explorer/testdata/package/with_library.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest library "Foo" api; +package ExplorerTest library "Foo" api; fn Main() -> i32 { return 0; diff --git a/executable_semantics/testdata/pointer/basic.carbon b/explorer/testdata/pointer/basic.carbon similarity index 74% rename from executable_semantics/testdata/pointer/basic.carbon rename to explorer/testdata/pointer/basic.carbon index aed35681b12f..b970849f83f8 100644 --- a/executable_semantics/testdata/pointer/basic.carbon +++ b/explorer/testdata/pointer/basic.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 5; diff --git a/executable_semantics/testdata/pointer/fail_rvalue_addressof.carbon b/explorer/testdata/pointer/fail_rvalue_addressof.carbon similarity index 53% rename from executable_semantics/testdata/pointer/fail_rvalue_addressof.carbon rename to explorer/testdata/pointer/fail_rvalue_addressof.carbon index 139c72556678..700788f7fa61 100644 --- a/executable_semantics/testdata/pointer/fail_rvalue_addressof.carbon +++ b/explorer/testdata/pointer/fail_rvalue_addressof.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/pointer/fail_rvalue_addressof.carbon:16: Argument to & should be an lvalue. +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/pointer/fail_rvalue_addressof.carbon:16: Argument to & should be an lvalue. -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 5; diff --git a/executable_semantics/testdata/pointer/struct_pointer.carbon b/explorer/testdata/pointer/struct_pointer.carbon similarity index 70% rename from executable_semantics/testdata/pointer/struct_pointer.carbon rename to explorer/testdata/pointer/struct_pointer.carbon index 9e654e0463bc..743b3990b7f2 100644 --- a/executable_semantics/testdata/pointer/struct_pointer.carbon +++ b/explorer/testdata/pointer/struct_pointer.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: auto = {.x = 10, .y = 1}; diff --git a/executable_semantics/testdata/return/explicit_empty.carbon b/explorer/testdata/return/explicit_empty.carbon similarity index 68% rename from executable_semantics/testdata/return/explicit_empty.carbon rename to explorer/testdata/return/explicit_empty.carbon index ce69792d120e..075c9bf490f6 100644 --- a/executable_semantics/testdata/return/explicit_empty.carbon +++ b/explorer/testdata/return/explicit_empty.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn F() -> () { return (); diff --git a/explorer/testdata/return/fail_explicit_with_no_return.carbon b/explorer/testdata/return/fail_explicit_with_no_return.carbon new file mode 100644 index 000000000000..deba307b960f --- /dev/null +++ b/explorer/testdata/return/fail_explicit_with_no_return.carbon @@ -0,0 +1,20 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/return/fail_explicit_with_no_return.carbon:15: control-flow reaches end of function that provides a `->` return type without reaching a return statement + +package ExplorerTest api; + +fn F() -> () { +} + +fn Main() -> i32 { + F(); + return 0; +} diff --git a/executable_semantics/testdata/return/fail_explicit_with_plain_return.carbon b/explorer/testdata/return/fail_explicit_with_plain_return.carbon similarity index 50% rename from executable_semantics/testdata/return/fail_explicit_with_plain_return.carbon rename to explorer/testdata/return/fail_explicit_with_plain_return.carbon index 95398aa94c69..3f70dd54b9b7 100644 --- a/executable_semantics/testdata/return/fail_explicit_with_plain_return.carbon +++ b/explorer/testdata/return/fail_explicit_with_plain_return.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/return/fail_explicit_with_plain_return.carbon:15: return; should provide a return value, to match the function's signature. +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/return/fail_explicit_with_plain_return.carbon:15: return; should provide a return value, to match the function's signature. -package ExecutableSemanticsTest api; +package ExplorerTest api; fn F() -> () { return; diff --git a/explorer/testdata/return/fail_implicit_with_explicit_return.carbon b/explorer/testdata/return/fail_implicit_with_explicit_return.carbon new file mode 100644 index 000000000000..cb5be1a55887 --- /dev/null +++ b/explorer/testdata/return/fail_implicit_with_explicit_return.carbon @@ -0,0 +1,21 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/return/fail_implicit_with_explicit_return.carbon:15: return (); should not provide a return value, to match the function's signature. + +package ExplorerTest api; + +fn F() { + return (); +} + +fn Main() -> i32 { + F(); + return 0; +} diff --git a/executable_semantics/testdata/return/implicit_with_no_return.carbon b/explorer/testdata/return/implicit_with_no_return.carbon similarity index 67% rename from executable_semantics/testdata/return/implicit_with_no_return.carbon rename to explorer/testdata/return/implicit_with_no_return.carbon index c7d3c0073625..d0445fbfb2c0 100644 --- a/executable_semantics/testdata/return/implicit_with_no_return.carbon +++ b/explorer/testdata/return/implicit_with_no_return.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn F() { } diff --git a/executable_semantics/testdata/return/implicit_with_plain_return.carbon b/explorer/testdata/return/implicit_with_plain_return.carbon similarity index 68% rename from executable_semantics/testdata/return/implicit_with_plain_return.carbon rename to explorer/testdata/return/implicit_with_plain_return.carbon index 9c6e9196429a..ef4330c9b764 100644 --- a/executable_semantics/testdata/return/implicit_with_plain_return.carbon +++ b/explorer/testdata/return/implicit_with_plain_return.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn F() { return; diff --git a/executable_semantics/testdata/string/basic.carbon b/explorer/testdata/string/basic.carbon similarity index 71% rename from executable_semantics/testdata/string/basic.carbon rename to explorer/testdata/string/basic.carbon index 26edb6ceaf4d..bdfc92c0a503 100644 --- a/executable_semantics/testdata/string/basic.carbon +++ b/explorer/testdata/string/basic.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn CompareStr(s: String) -> i32 { if (s == "str") { diff --git a/executable_semantics/testdata/string/block.carbon b/explorer/testdata/string/block.carbon similarity index 74% rename from executable_semantics/testdata/string/block.carbon rename to explorer/testdata/string/block.carbon index 91a248f1dba3..3896c18552b8 100644 --- a/executable_semantics/testdata/string/block.carbon +++ b/explorer/testdata/string/block.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var s: String = """ diff --git a/executable_semantics/testdata/string/block_escaped_triple_quotes.carbon b/explorer/testdata/string/block_escaped_triple_quotes.carbon similarity index 73% rename from executable_semantics/testdata/string/block_escaped_triple_quotes.carbon rename to explorer/testdata/string/block_escaped_triple_quotes.carbon index 3edc91b52500..9ea46d4fdf42 100644 --- a/executable_semantics/testdata/string/block_escaped_triple_quotes.carbon +++ b/explorer/testdata/string/block_escaped_triple_quotes.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var s: String = """ diff --git a/executable_semantics/testdata/string/fail_block_quotes_not_on_own_line.carbon b/explorer/testdata/string/fail_block_quotes_not_on_own_line.carbon similarity index 52% rename from executable_semantics/testdata/string/fail_block_quotes_not_on_own_line.carbon rename to explorer/testdata/string/fail_block_quotes_not_on_own_line.carbon index 0105898231d5..57d0fa581273 100644 --- a/executable_semantics/testdata/string/fail_block_quotes_not_on_own_line.carbon +++ b/explorer/testdata/string/fail_block_quotes_not_on_own_line.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/string/fail_block_quotes_not_on_own_line.carbon:15: Invalid block string: Should end with triple quotes: error: closing """ +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/string/fail_block_quotes_not_on_own_line.carbon:15: Invalid block string: Should end with triple quotes: error: closing """ -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var s: String = """ diff --git a/explorer/testdata/string/fail_hex_lower.carbon b/explorer/testdata/string/fail_hex_lower.carbon new file mode 100644 index 000000000000..009723f401e6 --- /dev/null +++ b/explorer/testdata/string/fail_hex_lower.carbon @@ -0,0 +1,17 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/string/fail_hex_lower.carbon:15: Invalid escaping in string: "str\xaa" + +package ExplorerTest api; + +fn Main() -> i32 { + Print("str\xaa"); + return 0; +} diff --git a/explorer/testdata/string/fail_hex_truncated.carbon b/explorer/testdata/string/fail_hex_truncated.carbon new file mode 100644 index 000000000000..9769c975393d --- /dev/null +++ b/explorer/testdata/string/fail_hex_truncated.carbon @@ -0,0 +1,17 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/string/fail_hex_truncated.carbon:15: Invalid escaping in string: "str\x" + +package ExplorerTest api; + +fn Main() -> i32 { + Print("str\x"); + return 0; +} diff --git a/explorer/testdata/string/fail_invalid_escape.carbon b/explorer/testdata/string/fail_invalid_escape.carbon new file mode 100644 index 000000000000..7863df635d45 --- /dev/null +++ b/explorer/testdata/string/fail_invalid_escape.carbon @@ -0,0 +1,17 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/string/fail_invalid_escape.carbon:15: Invalid escaping in string: "str\e" + +package ExplorerTest api; + +fn Main() -> i32 { + Print("str\e"); + return 0; +} diff --git a/explorer/testdata/string/fail_newline.carbon b/explorer/testdata/string/fail_newline.carbon new file mode 100644 index 000000000000..a249f883499e --- /dev/null +++ b/explorer/testdata/string/fail_newline.carbon @@ -0,0 +1,18 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/string/fail_newline.carbon:15: invalid character '\x22' in source file. + +package ExplorerTest api; + +fn Main() -> i32 { + Print("new +line"); + return 0; +} diff --git a/explorer/testdata/string/fail_octal.carbon b/explorer/testdata/string/fail_octal.carbon new file mode 100644 index 000000000000..b949f8850182 --- /dev/null +++ b/explorer/testdata/string/fail_octal.carbon @@ -0,0 +1,17 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/string/fail_octal.carbon:15: Invalid escaping in string: "str\01" + +package ExplorerTest api; + +fn Main() -> i32 { + Print("str\01"); + return 0; +} diff --git a/explorer/testdata/string/fail_tab.carbon b/explorer/testdata/string/fail_tab.carbon new file mode 100644 index 000000000000..c7e94bbbe1f6 --- /dev/null +++ b/explorer/testdata/string/fail_tab.carbon @@ -0,0 +1,17 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// RUN: %{not} %{explorer} %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/string/fail_tab.carbon:15: Invalid escaping in string: "new line" + +package ExplorerTest api; + +fn Main() -> i32 { + Print("new line"); + return 0; +} diff --git a/executable_semantics/testdata/string/hex.carbon b/explorer/testdata/string/hex.carbon similarity index 72% rename from executable_semantics/testdata/string/hex.carbon rename to explorer/testdata/string/hex.carbon index 7084e6af754c..3fd0cc18acea 100644 --- a/executable_semantics/testdata/string/hex.carbon +++ b/explorer/testdata/string/hex.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn CompareStr(s: String) -> i32 { if (s == "str;") { diff --git a/executable_semantics/testdata/string/newline.carbon b/explorer/testdata/string/newline.carbon similarity index 71% rename from executable_semantics/testdata/string/newline.carbon rename to explorer/testdata/string/newline.carbon index f6e732d2c7a9..3762a73072b7 100644 --- a/executable_semantics/testdata/string/newline.carbon +++ b/explorer/testdata/string/newline.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn CompareStr(s: String) -> i32 { if (s == "str\n") { diff --git a/executable_semantics/testdata/struct/assign.carbon b/explorer/testdata/struct/assign.carbon similarity index 70% rename from executable_semantics/testdata/struct/assign.carbon rename to explorer/testdata/struct/assign.carbon index 760b0bbaf48d..113c2746489f 100644 --- a/executable_semantics/testdata/struct/assign.carbon +++ b/explorer/testdata/struct/assign.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: auto = {.x = 0, .y = 1}; diff --git a/executable_semantics/testdata/struct/assign_member.carbon b/explorer/testdata/struct/assign_member.carbon similarity index 70% rename from executable_semantics/testdata/struct/assign_member.carbon rename to explorer/testdata/struct/assign_member.carbon index 3d962f29fb8e..f0768b476a14 100644 --- a/executable_semantics/testdata/struct/assign_member.carbon +++ b/explorer/testdata/struct/assign_member.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var p1: auto = {.x = 1, .y = 2}; diff --git a/executable_semantics/testdata/struct/empty.carbon b/explorer/testdata/struct/empty.carbon similarity index 73% rename from executable_semantics/testdata/struct/empty.carbon rename to explorer/testdata/struct/empty.carbon index d923ba419b7f..3452ac0363aa 100644 --- a/executable_semantics/testdata/struct/empty.carbon +++ b/explorer/testdata/struct/empty.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var empty: {} = {}; diff --git a/executable_semantics/testdata/struct/ending_comma.carbon b/explorer/testdata/struct/ending_comma.carbon similarity index 71% rename from executable_semantics/testdata/struct/ending_comma.carbon rename to explorer/testdata/struct/ending_comma.carbon index f386b44f354d..72b4830507ba 100644 --- a/executable_semantics/testdata/struct/ending_comma.carbon +++ b/explorer/testdata/struct/ending_comma.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: {.x: i32,} = {.x = 5,}; diff --git a/executable_semantics/testdata/struct/equality.carbon b/explorer/testdata/struct/equality.carbon similarity index 73% rename from executable_semantics/testdata/struct/equality.carbon rename to explorer/testdata/struct/equality.carbon index 9128880f2bdd..02aaf865ae5c 100644 --- a/executable_semantics/testdata/struct/equality.carbon +++ b/explorer/testdata/struct/equality.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: {.x: i32, .y: i32} = {.x = 5, .y = 2}; diff --git a/executable_semantics/testdata/struct/equality_false.carbon b/explorer/testdata/struct/equality_false.carbon similarity index 73% rename from executable_semantics/testdata/struct/equality_false.carbon rename to explorer/testdata/struct/equality_false.carbon index 5e40071ee133..20247cde9b58 100644 --- a/executable_semantics/testdata/struct/equality_false.carbon +++ b/explorer/testdata/struct/equality_false.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: {.x: i32, .y: i32} = {.x = 5, .y = 2}; diff --git a/executable_semantics/testdata/struct/fail_equality_type.carbon b/explorer/testdata/struct/fail_equality_type.carbon similarity index 61% rename from executable_semantics/testdata/struct/fail_equality_type.carbon rename to explorer/testdata/struct/fail_equality_type.carbon index 6bca2a1b4d0e..1451111b2989 100644 --- a/executable_semantics/testdata/struct/fail_equality_type.carbon +++ b/explorer/testdata/struct/fail_equality_type.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 2>&1 | %{FileCheck} %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/struct/fail_equality_type.carbon:16: type error in == +// RUN: %{not} %{explorer} %s 2>&1 2>&1 | %{FileCheck} %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/struct/fail_equality_type.carbon:16: type error in == // CHECK: expected: {.x: i32, .y: i32} // CHECK: actual: {.x: i32} -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: {.x: i32, .y: i32} = {.x = 5, .y = 2}; diff --git a/executable_semantics/testdata/struct/fail_field_access_mismatch.carbon b/explorer/testdata/struct/fail_field_access_mismatch.carbon similarity index 51% rename from executable_semantics/testdata/struct/fail_field_access_mismatch.carbon rename to explorer/testdata/struct/fail_field_access_mismatch.carbon index c710aafd2506..449448fb183f 100644 --- a/executable_semantics/testdata/struct/fail_field_access_mismatch.carbon +++ b/explorer/testdata/struct/fail_field_access_mismatch.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/struct/fail_field_access_mismatch.carbon:15: struct {.x: i32, .y: i32} does not have a field named z +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/struct/fail_field_access_mismatch.carbon:15: struct {.x: i32, .y: i32} does not have a field named z -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { return {.x = 1, .y = 2}.z - 1; diff --git a/executable_semantics/testdata/struct/name_order.carbon b/explorer/testdata/struct/name_order.carbon similarity index 71% rename from executable_semantics/testdata/struct/name_order.carbon rename to explorer/testdata/struct/name_order.carbon index f4af45f21243..2535bcaa13d7 100644 --- a/executable_semantics/testdata/struct/name_order.carbon +++ b/explorer/testdata/struct/name_order.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test the that field order doesn't matter for structs. diff --git a/executable_semantics/testdata/struct/temp.carbon b/explorer/testdata/struct/temp.carbon similarity index 67% rename from executable_semantics/testdata/struct/temp.carbon rename to explorer/testdata/struct/temp.carbon index 07490c9e7116..c12cfdcd02c5 100644 --- a/executable_semantics/testdata/struct/temp.carbon +++ b/explorer/testdata/struct/temp.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { return {.x = 1, .y = 2}.x - 1; diff --git a/executable_semantics/testdata/struct/var.carbon b/explorer/testdata/struct/var.carbon similarity index 69% rename from executable_semantics/testdata/struct/var.carbon rename to explorer/testdata/struct/var.carbon index cd361b71df31..49b66a53f819 100644 --- a/executable_semantics/testdata/struct/var.carbon +++ b/explorer/testdata/struct/var.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var p: {.x: i32, .y: i32} = {.x = 1, .y = 2}; diff --git a/executable_semantics/testdata/tuple/ending_comma.carbon b/explorer/testdata/tuple/ending_comma.carbon similarity index 70% rename from executable_semantics/testdata/tuple/ending_comma.carbon rename to explorer/testdata/tuple/ending_comma.carbon index da014341e16f..5182b347212c 100644 --- a/executable_semantics/testdata/tuple/ending_comma.carbon +++ b/explorer/testdata/tuple/ending_comma.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: (i32,) = (5,); diff --git a/executable_semantics/testdata/tuple/equality.carbon b/explorer/testdata/tuple/equality.carbon similarity index 71% rename from executable_semantics/testdata/tuple/equality.carbon rename to explorer/testdata/tuple/equality.carbon index 277cf3afb735..5d6da7823507 100644 --- a/executable_semantics/testdata/tuple/equality.carbon +++ b/explorer/testdata/tuple/equality.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: (i32, i32) = (5, 2); diff --git a/executable_semantics/testdata/tuple/equality_false.carbon b/explorer/testdata/tuple/equality_false.carbon similarity index 71% rename from executable_semantics/testdata/tuple/equality_false.carbon rename to explorer/testdata/tuple/equality_false.carbon index 5d7cb04b1b94..f441d27458b2 100644 --- a/executable_semantics/testdata/tuple/equality_false.carbon +++ b/explorer/testdata/tuple/equality_false.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: (i32, i32) = (5, 2); diff --git a/executable_semantics/testdata/tuple/fail_equality_type.carbon b/explorer/testdata/tuple/fail_equality_type.carbon similarity index 59% rename from executable_semantics/testdata/tuple/fail_equality_type.carbon rename to explorer/testdata/tuple/fail_equality_type.carbon index 083b48cecbaf..f11a8d0094df 100644 --- a/executable_semantics/testdata/tuple/fail_equality_type.carbon +++ b/explorer/testdata/tuple/fail_equality_type.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 2>&1 | %{FileCheck} %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/tuple/fail_equality_type.carbon:16: type error in == +// RUN: %{not} %{explorer} %s 2>&1 2>&1 | %{FileCheck} %s +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/tuple/fail_equality_type.carbon:16: type error in == // CHECK: expected: (i32, i32) // CHECK: actual: (i32) -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t1: (i32, i32) = (5, 2); diff --git a/executable_semantics/testdata/tuple/fail_index.carbon b/explorer/testdata/tuple/fail_index.carbon similarity index 53% rename from executable_semantics/testdata/tuple/fail_index.carbon rename to explorer/testdata/tuple/fail_index.carbon index 90caab2d9637..c548f1f3e370 100644 --- a/executable_semantics/testdata/tuple/fail_index.carbon +++ b/explorer/testdata/tuple/fail_index.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/tuple/fail_index.carbon:16: index 2 is out of range for type (i32, i32) +// AUTOUPDATE: %{explorer} %s +// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/tuple/fail_index.carbon:16: index 2 is out of range for type (i32, i32) -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: auto = (0, 1); diff --git a/executable_semantics/testdata/tuple/fail_index_var.carbon b/explorer/testdata/tuple/fail_index_var.carbon similarity index 56% rename from executable_semantics/testdata/tuple/fail_index_var.carbon rename to explorer/testdata/tuple/fail_index_var.carbon index 20851bffd080..d3187b593f1e 100644 --- a/executable_semantics/testdata/tuple/fail_index_var.carbon +++ b/explorer/testdata/tuple/fail_index_var.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{not} %{executable_semantics} %s 2>&1 | \ +// RUN: %{not} %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s -// CHECK: RUNTIME ERROR: {{.*}}/executable_semantics/testdata/tuple/fail_index_var.carbon:17: could not find `index: i32` +// AUTOUPDATE: %{explorer} %s +// CHECK: RUNTIME ERROR: {{.*}}/explorer/testdata/tuple/fail_index_var.carbon:17: could not find `index: i32` -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: auto = (0, 1); diff --git a/executable_semantics/testdata/tuple/index.carbon b/explorer/testdata/tuple/index.carbon similarity index 68% rename from executable_semantics/testdata/tuple/index.carbon rename to explorer/testdata/tuple/index.carbon index c4451af88e78..c0b9b7e3017e 100644 --- a/executable_semantics/testdata/tuple/index.carbon +++ b/explorer/testdata/tuple/index.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: auto = (0, 1); diff --git a/executable_semantics/testdata/tuple/match.carbon b/explorer/testdata/tuple/match.carbon similarity index 71% rename from executable_semantics/testdata/tuple/match.carbon rename to explorer/testdata/tuple/match.carbon index 9eb0c7bad780..9ab93a96544d 100644 --- a/executable_semantics/testdata/tuple/match.carbon +++ b/explorer/testdata/tuple/match.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var t: auto = (5, 2); diff --git a/executable_semantics/testdata/tuple/match_nested.carbon b/explorer/testdata/tuple/match_nested.carbon similarity index 74% rename from executable_semantics/testdata/tuple/match_nested.carbon rename to explorer/testdata/tuple/match_nested.carbon index 918a2afcb24f..c0d5e43c8053 100644 --- a/executable_semantics/testdata/tuple/match_nested.carbon +++ b/explorer/testdata/tuple/match_nested.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; // Test matching of a tuple inside a tuple. diff --git a/executable_semantics/testdata/tuple/no_ending_comma.carbon b/explorer/testdata/tuple/no_ending_comma.carbon similarity index 70% rename from executable_semantics/testdata/tuple/no_ending_comma.carbon rename to explorer/testdata/tuple/no_ending_comma.carbon index 311176c9149c..0058f95ef6fc 100644 --- a/executable_semantics/testdata/tuple/no_ending_comma.carbon +++ b/explorer/testdata/tuple/no_ending_comma.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = (1); diff --git a/executable_semantics/testdata/while/basic.carbon b/explorer/testdata/while/basic.carbon similarity index 69% rename from executable_semantics/testdata/while/basic.carbon rename to explorer/testdata/while/basic.carbon index c86087714734..d3166fa2b8c2 100644 --- a/executable_semantics/testdata/while/basic.carbon +++ b/explorer/testdata/while/basic.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: auto = 2; diff --git a/executable_semantics/testdata/while/break.carbon b/explorer/testdata/while/break.carbon similarity index 71% rename from executable_semantics/testdata/while/break.carbon rename to explorer/testdata/while/break.carbon index d58cc570ffb8..285f613ab7dd 100644 --- a/executable_semantics/testdata/while/break.carbon +++ b/explorer/testdata/while/break.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: i32 = 2; diff --git a/executable_semantics/testdata/while/continue.carbon b/explorer/testdata/while/continue.carbon similarity index 71% rename from executable_semantics/testdata/while/continue.carbon rename to explorer/testdata/while/continue.carbon index 4a1272e27e0b..d92a066c884b 100644 --- a/executable_semantics/testdata/while/continue.carbon +++ b/explorer/testdata/while/continue.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// RUN: %{executable_semantics} %s 2>&1 | \ +// RUN: %{explorer} %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s -// RUN: %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ +// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s -// AUTOUPDATE: %{executable_semantics} %s +// AUTOUPDATE: %{explorer} %s // CHECK: result: 0 -package ExecutableSemanticsTest api; +package ExplorerTest api; fn Main() -> i32 { var x: auto = 2; diff --git a/executable_semantics/update_checks.py b/explorer/update_checks.py similarity index 92% rename from executable_semantics/update_checks.py rename to explorer/update_checks.py index 467d33ff76f0..ae378ef41cca 100755 --- a/executable_semantics/update_checks.py +++ b/explorer/update_checks.py @@ -14,8 +14,8 @@ import subprocess import sys from typing import Set -_BIN = "./bazel-bin/executable_semantics/executable_semantics" -_TESTDATA = "executable_semantics/testdata" +_BIN = "./bazel-bin/explorer/explorer" +_TESTDATA = "explorer/testdata" # A prefix followed by a command to run for autoupdating checked output. _AUTOUPDATE_MARKER = "// AUTOUPDATE: " @@ -40,7 +40,7 @@ def _get_tests() -> Set[str]: def _update_check_once(test: str) -> bool: - """Updates the CHECK: lines for `test` by running executable_semantics. + """Updates the CHECK: lines for `test` by running explorer. Returns True if the number of lines changes. """ @@ -75,7 +75,7 @@ def _update_check_once(test: str) -> bool: ) # Mirror lit.cfg.py substitutions; bazel runs don't need --prelude. - autoupdate_cmd = autoupdate_cmd.replace("%{executable_semantics}", _BIN) + autoupdate_cmd = autoupdate_cmd.replace("%{explorer}", _BIN) # Run the autoupdate command to generate output. # (`bazel run` would serialize) @@ -126,8 +126,8 @@ def _update_checks() -> None: tests = _get_tests() # Build all tests at once in order to allow parallel updates. - print("Building executable_semantics...") - subprocess.check_call(["bazel", "build", "//executable_semantics"]) + print("Building explorer...") + subprocess.check_call(["bazel", "build", "//explorer"]) print("Updating %d lit tests..." % len(tests)) with futures.ThreadPoolExecutor() as exec: diff --git a/installers/local/BUILD b/installers/local/BUILD index cf85c4025794..16bac9ab1ec6 100644 --- a/installers/local/BUILD +++ b/installers/local/BUILD @@ -36,11 +36,11 @@ sh_binary( "$(INSTALL_PATH)", "--carbon", "$(location :carbon)", - "$(locations //executable_semantics:standard_libraries)", + "$(locations //explorer:standard_libraries)", ], data = [ ":carbon", - "//executable_semantics:standard_libraries", + "//explorer:standard_libraries", ], toolchains = [":install_path"], ) @@ -62,7 +62,7 @@ cc_binary( srcs = ["carbon.cpp"], visibility = ["//bazel/check_deps:__pkg__"], deps = [ - "//executable_semantics:main", + "//explorer:main", "@llvm-project//llvm:Support", ], ) diff --git a/installers/local/carbon.cpp b/installers/local/carbon.cpp index 797da4287b36..5549d9ce4391 100644 --- a/installers/local/carbon.cpp +++ b/installers/local/carbon.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "executable_semantics/main.h" +#include "explorer/main.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" @@ -19,7 +19,7 @@ auto main(int argc, char** argv) -> int { llvm::StringRef install_path = path::parent_path(exe); llvm::SmallString<256> prelude_file(install_path); path::append(prelude_file, "data", "prelude.carbon"); - return Carbon::ExecutableSemanticsMain(prelude_file, argc, argv); + return Carbon::ExplorerMain(prelude_file, argc, argv); } else { fprintf(stderr, "Unrecognized Carbon binary requested: %s", argv[0]); return 1;