mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Update tests to use [[@TEST_NAME]] (#4293)
Applies #4278 TEST_NAME substitution to tests. Note I've tried to structure commits as: 1. Do all the replacements. 2. autoupdate (nothing else) -- this shows incorrect updates. 3. Fix up manually, including autoupdates to get back to original output.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
// --- api.carbon
|
||||
|
||||
library "api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn A();
|
||||
fn B(b: i32) -> i32;
|
||||
@@ -26,7 +26,7 @@ fn NS.E();
|
||||
|
||||
// --- extern_api.carbon
|
||||
|
||||
library "extern_api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern library "redecl_extern_api" fn A();
|
||||
extern library "redecl_extern_api" fn B(b: i32) -> i32;
|
||||
@@ -42,7 +42,7 @@ extern library "redecl_extern_api" fn NS.E();
|
||||
|
||||
// --- basics.carbon
|
||||
|
||||
library "basics";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "api";
|
||||
|
||||
@@ -54,7 +54,7 @@ var e: () = NS.E();
|
||||
|
||||
// --- fail_redecl_api.carbon
|
||||
|
||||
library "redecl_api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "api";
|
||||
|
||||
@@ -122,7 +122,7 @@ var e: () = NS.E();
|
||||
|
||||
// --- redecl_extern_api.carbon
|
||||
|
||||
library "redecl_extern_api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_api";
|
||||
|
||||
@@ -140,7 +140,7 @@ var e: () = NS.E();
|
||||
|
||||
// --- fail_merge.carbon
|
||||
|
||||
library "merge";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+65]]:1: In import.
|
||||
// CHECK:STDERR: import library "api";
|
||||
@@ -218,7 +218,7 @@ var e: () = NS.E();
|
||||
|
||||
// --- fail_merge_reverse.carbon
|
||||
|
||||
library "merge_reverse";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+64]]:1: In import.
|
||||
// CHECK:STDERR: import library "extern_api";
|
||||
@@ -295,13 +295,13 @@ var e: () = NS.E();
|
||||
|
||||
// --- unloaded.carbon
|
||||
|
||||
library "unloaded";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "api";
|
||||
|
||||
// --- unloaded_extern.carbon
|
||||
|
||||
library "unloaded_extern";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_api";
|
||||
|
||||
|
||||
+3
-3
@@ -14,13 +14,13 @@
|
||||
|
||||
// --- base.carbon
|
||||
|
||||
library "base";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F();
|
||||
|
||||
// --- export.carbon
|
||||
|
||||
library "export";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "base";
|
||||
|
||||
@@ -32,7 +32,7 @@ export F;
|
||||
|
||||
// --- use_export.carbon
|
||||
|
||||
library "use_export";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "export";
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// --- basic.carbon
|
||||
|
||||
library "basic";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
|
||||
@@ -22,7 +22,7 @@ var x: () = F();
|
||||
|
||||
// --- fail_redecl.carbon
|
||||
|
||||
library "redecl";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant.
|
||||
@@ -36,7 +36,7 @@ extern fn F();
|
||||
|
||||
// --- fail_redecl_extern.carbon
|
||||
|
||||
library "redecl_extern";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant.
|
||||
@@ -50,7 +50,7 @@ fn F();
|
||||
|
||||
// --- fail_member_extern.carbon
|
||||
|
||||
library "member_extern";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: ERROR: `extern` not allowed on `fn` declaration that is a member.
|
||||
|
||||
+13
-13
@@ -10,13 +10,13 @@
|
||||
|
||||
// --- extern_library.carbon
|
||||
|
||||
library "extern_library";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern library "extern_library_owner" fn F();
|
||||
|
||||
// --- extern_library_owner.carbon
|
||||
|
||||
library "extern_library_owner";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
@@ -24,7 +24,7 @@ extern fn F();
|
||||
|
||||
// --- fail_extern_library_nonowner.carbon
|
||||
|
||||
library "extern_library_nonowner";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
@@ -42,7 +42,7 @@ extern fn F();
|
||||
|
||||
// --- fail_extern_library_nonextern.carbon
|
||||
|
||||
library "extern_library_nonextern";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
@@ -60,11 +60,11 @@ fn F();
|
||||
|
||||
// --- fail_extern_library_redecl.carbon
|
||||
|
||||
library "fail_extern_library_redecl";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+10]]:1: ERROR: Declaration in library "fail_extern_library_redecl" doesn't match `extern library` declaration.
|
||||
// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+10]]:1: ERROR: Declaration in library "extern_library_redecl" doesn't match `extern library` declaration.
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE-5]]:1: In import.
|
||||
@@ -78,13 +78,13 @@ extern library "extern_library_owner" fn F();
|
||||
|
||||
// --- extern_library_copy.carbon
|
||||
|
||||
library "extern_library_copy";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern library "extern_library_owner" fn F();
|
||||
|
||||
// --- fail_extern_library_collision.carbon
|
||||
|
||||
library "extern_library_collision";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+13]]:1: In import.
|
||||
// CHECK:STDERR: import library "extern_library";
|
||||
@@ -104,13 +104,13 @@ import library "extern_library_copy";
|
||||
|
||||
// --- extern_library_mismatch.carbon
|
||||
|
||||
library "extern_library_mismatch";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern library "extern_library_owner" fn F();
|
||||
|
||||
// --- fail_extern_library_mismatch_owner.carbon
|
||||
|
||||
library "extern_library_mismatch_owner";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library_mismatch"
|
||||
|
||||
@@ -122,7 +122,7 @@ extern fn F();
|
||||
|
||||
// --- fail_extern_self_library.carbon
|
||||
|
||||
library "extern_self_library";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: ERROR: `extern library` cannot specify the current library.
|
||||
// CHECK:STDERR: extern library "extern_self_library" fn F();
|
||||
@@ -132,13 +132,13 @@ extern library "extern_self_library" fn F();
|
||||
|
||||
// --- extern_of_import.carbon
|
||||
|
||||
library "extern_of_import";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F();
|
||||
|
||||
// --- fail_extern_of_import_redecl.carbon
|
||||
|
||||
library "extern_of_import_redecl";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_of_import";
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ extern library "expected" fn F();
|
||||
|
||||
// --- expected.carbon
|
||||
|
||||
package Foo library "expected";
|
||||
package Foo library "[[@TEST_NAME]]";
|
||||
|
||||
import library default;
|
||||
|
||||
@@ -24,7 +24,7 @@ extern fn F();
|
||||
|
||||
// --- fail_wrong_library.carbon
|
||||
|
||||
package Foo library "wrong_library";
|
||||
package Foo library "[[@TEST_NAME]]";
|
||||
|
||||
import library default;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -10,7 +10,7 @@
|
||||
|
||||
// --- extern_library.carbon
|
||||
|
||||
library "extern_library";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern library default fn F();
|
||||
|
||||
@@ -22,7 +22,7 @@ extern fn F();
|
||||
|
||||
// --- fail_wrong_library.carbon
|
||||
|
||||
library "wrong_library";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
|
||||
Vendored
+15
-15
@@ -10,7 +10,7 @@
|
||||
|
||||
// --- fail_incomplete_return.carbon
|
||||
|
||||
library "api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C;
|
||||
class D;
|
||||
@@ -49,22 +49,22 @@ class D {}
|
||||
|
||||
// --- fail_use_imported.carbon
|
||||
|
||||
library "use_imported";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "api";
|
||||
import library "incomplete_return";
|
||||
|
||||
fn CallFAndGIncomplete() {
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+16]]:3: ERROR: Function returns incomplete type `C`.
|
||||
// CHECK:STDERR: ReturnCUnused();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: In import.
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: import library "incomplete_return";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:4:1: Class was forward declared here.
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-12]]:1: In import.
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: import library "incomplete_return";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:7:20: Return type declared here.
|
||||
// CHECK:STDERR: fn ReturnCUnused() -> C;
|
||||
@@ -75,13 +75,13 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDERR: ReturnCUsed();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: In import.
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: import library "incomplete_return";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:4:1: Class was forward declared here.
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-29]]:1: In import.
|
||||
// CHECK:STDERR: import library "api";
|
||||
// CHECK:STDERR: import library "incomplete_return";
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:8:18: Return type declared here.
|
||||
// CHECK:STDERR: fn ReturnCUsed() -> C;
|
||||
@@ -187,14 +187,14 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %import_ref.1 = import_ref Main//api, inst+1, unloaded
|
||||
// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+3, unloaded
|
||||
// CHECK:STDOUT: %import_ref.3: %ReturnCUnused.type = import_ref Main//api, inst+7, loaded [template = constants.%ReturnCUnused]
|
||||
// CHECK:STDOUT: %import_ref.4: %ReturnCUsed.type = import_ref Main//api, inst+13, loaded [template = constants.%ReturnCUsed]
|
||||
// CHECK:STDOUT: %import_ref.5: %ReturnDUnused.type = import_ref Main//api, inst+18, loaded [template = constants.%ReturnDUnused]
|
||||
// CHECK:STDOUT: %import_ref.6: %ReturnDUsed.type = import_ref Main//api, inst+23, loaded [template = constants.%ReturnDUsed]
|
||||
// CHECK:STDOUT: %import_ref.7 = import_ref Main//api, inst+26, unloaded
|
||||
// CHECK:STDOUT: %import_ref.8 = import_ref Main//api, inst+4, unloaded
|
||||
// CHECK:STDOUT: %import_ref.1 = import_ref Main//incomplete_return, inst+1, unloaded
|
||||
// CHECK:STDOUT: %import_ref.2 = import_ref Main//incomplete_return, inst+3, unloaded
|
||||
// CHECK:STDOUT: %import_ref.3: %ReturnCUnused.type = import_ref Main//incomplete_return, inst+7, loaded [template = constants.%ReturnCUnused]
|
||||
// CHECK:STDOUT: %import_ref.4: %ReturnCUsed.type = import_ref Main//incomplete_return, inst+13, loaded [template = constants.%ReturnCUsed]
|
||||
// CHECK:STDOUT: %import_ref.5: %ReturnDUnused.type = import_ref Main//incomplete_return, inst+18, loaded [template = constants.%ReturnDUnused]
|
||||
// CHECK:STDOUT: %import_ref.6: %ReturnDUsed.type = import_ref Main//incomplete_return, inst+23, loaded [template = constants.%ReturnDUsed]
|
||||
// CHECK:STDOUT: %import_ref.7 = import_ref Main//incomplete_return, inst+26, unloaded
|
||||
// CHECK:STDOUT: %import_ref.8 = import_ref Main//incomplete_return, inst+4, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@
|
||||
|
||||
// --- fail_no_body.carbon
|
||||
|
||||
library "no_body";
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: ERROR: Semantics TODO: `function with positional parameters`.
|
||||
// CHECK:STDERR: fn A;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
@@ -19,7 +19,7 @@ fn A;
|
||||
|
||||
// --- fail_todo_brace_body.carbon
|
||||
|
||||
library "brace_body";
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: ERROR: Semantics TODO: `function with positional parameters`.
|
||||
// CHECK:STDERR: fn A {
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
@@ -30,7 +30,7 @@ fn A {
|
||||
// --- fail_todo_arrow_body.carbon
|
||||
|
||||
// TODO: We don't have parsing support for this yet.
|
||||
library "arrow_body";
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+7]]:1: ERROR: Semantics TODO: `function with positional parameters`.
|
||||
// CHECK:STDERR: fn A => 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
|
||||
+6
-6
@@ -10,25 +10,25 @@
|
||||
|
||||
// --- basic.carbon
|
||||
|
||||
library "basic";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn A();
|
||||
|
||||
// --- basic.impl.carbon
|
||||
|
||||
impl library "basic";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
fn A() {}
|
||||
|
||||
// --- extern_api.carbon
|
||||
|
||||
library "extern_api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn A();
|
||||
|
||||
// --- fail_extern_api.impl.carbon
|
||||
|
||||
impl library "extern_api";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+14]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`.
|
||||
// CHECK:STDERR: fn A();
|
||||
@@ -48,13 +48,13 @@ fn A();
|
||||
|
||||
// --- extern_impl.carbon
|
||||
|
||||
library "extern_impl";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn A();
|
||||
|
||||
// --- fail_extern_impl.impl.carbon
|
||||
|
||||
impl library "extern_impl";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+9]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`.
|
||||
// CHECK:STDERR: extern fn A();
|
||||
|
||||
+10
-10
@@ -10,13 +10,13 @@
|
||||
|
||||
// --- decl_in_api_definition_in_impl.carbon
|
||||
|
||||
library "decl_in_api_definition_in_impl";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn A();
|
||||
|
||||
// --- decl_in_api_definition_in_impl.impl.carbon
|
||||
|
||||
impl library "decl_in_api_definition_in_impl";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
fn A();
|
||||
|
||||
@@ -24,33 +24,33 @@ fn A() {}
|
||||
|
||||
// --- use_decl_in_api.carbon
|
||||
|
||||
library "use_decl_in_api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// --- use_decl_in_api.impl.carbon
|
||||
|
||||
impl library "use_decl_in_api";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
import library "decl_in_api_definition_in_impl";
|
||||
|
||||
// --- decl_only_in_api.carbon
|
||||
|
||||
library "decl_only_in_api";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn B();
|
||||
|
||||
// --- decl_only_in_api.impl.carbon
|
||||
|
||||
impl library "decl_only_in_api";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// --- decl_in_api_decl_in_impl.carbon
|
||||
|
||||
library "decl_in_api_decl_in_impl";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn C();
|
||||
|
||||
// --- fail_decl_in_api_decl_in_impl.impl.carbon
|
||||
|
||||
impl library "decl_in_api_decl_in_impl";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: ERROR: No definition found for declaration in impl file
|
||||
// CHECK:STDERR: fn C();
|
||||
@@ -60,11 +60,11 @@ fn C();
|
||||
|
||||
// --- decl_only_in_impl.carbon
|
||||
|
||||
library "decl_only_in_impl";
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// --- fail_decl_only_in_impl.impl.carbon
|
||||
|
||||
impl library "decl_only_in_impl";
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: No definition found for declaration in impl file
|
||||
// CHECK:STDERR: fn D();
|
||||
|
||||
Reference in New Issue
Block a user