diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index c26a4205c63d..3826138bcaaf 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -14,14 +14,14 @@ // --- base.carbon -library "base"; +library "[[@TEST_NAME]]"; class C {} alias D = C; // --- export.carbon -library "export"; +library "[[@TEST_NAME]]"; import library "base"; @@ -29,7 +29,7 @@ export D; // --- export_orig.carbon -library "export_orig"; +library "[[@TEST_NAME]]"; import library "base"; @@ -41,7 +41,7 @@ export C; // --- use_export.carbon -library "use_export"; +library "[[@TEST_NAME]]"; import library "export"; @@ -49,7 +49,7 @@ var d: D = {}; // --- fail_orig_name_not_in_export.carbon -library "fail_orig_name_not_in_export"; +library "[[@TEST_NAME]]"; import library "export"; @@ -60,7 +60,7 @@ var c: C = {}; // --- indirect_compat.carbon -library "indirect_compat"; +library "[[@TEST_NAME]]"; import library "export"; import library "export_orig"; diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index f6d4098f56ff..d691dd0a9c68 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -10,7 +10,7 @@ // --- class1.carbon -library "class1"; +library "[[@TEST_NAME]]"; class C {} @@ -20,7 +20,7 @@ var a: C*; // --- class2.carbon -library "class2"; +library "[[@TEST_NAME]]"; import library "class1"; @@ -30,7 +30,7 @@ var b: c_alias*; // --- class3.carbon -library "class3"; +library "[[@TEST_NAME]]"; import library "class2"; @@ -38,7 +38,7 @@ var c: c_alias_alias*; // --- var1.carbon -library "var1"; +library "[[@TEST_NAME]]"; var a: () = (); @@ -46,7 +46,7 @@ alias a_alias = a; // --- var2.carbon -library "var2"; +library "[[@TEST_NAME]]"; import library "var1"; @@ -56,7 +56,7 @@ var b: () = a_alias; // --- fail_var3.carbon -library "var3"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_var3.carbon:[[@LINE+6]]:1: In import. // CHECK:STDERR: import library "var2"; diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index c72f384034fe..9feda8afec01 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -14,7 +14,7 @@ // --- def.carbon -package Test library "def"; +package Test library "[[@TEST_NAME]]"; class C {} private alias A = C; @@ -25,13 +25,13 @@ private alias A = C; // --- def.impl.carbon -impl package Test library "def"; +impl package Test library "[[@TEST_NAME]]"; var inst: A = {}; // --- fail_local_def.carbon -package Test library "fail_local_def"; +package Test library "[[@TEST_NAME]]"; import library "def"; @@ -43,7 +43,7 @@ var inst: A = {}; // --- fail_other_def.carbon -package Other library "fail_other_def"; +package Other library "[[@TEST_NAME]]"; import Test library "def"; diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index 4cf1ab26c76b..913c30234375 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class C { var v: (); } alias a = C; @@ -20,7 +20,7 @@ alias d = c; // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 18680eaf3a5c..28ae5e21216e 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -10,7 +10,7 @@ // --- adapt_class.carbon -library "adapt_class"; +library "[[@TEST_NAME]]"; class A { var x: i32; @@ -36,7 +36,7 @@ var b_factory: B = A.Make() as B; // --- adapt_i32.carbon -library "adapt_i32"; +library "[[@TEST_NAME]]"; class A { adapt i32; @@ -47,7 +47,7 @@ let n: i32 = a as i32; // --- multi_level_adapt.carbon -library "multi_level_adapt"; +library "[[@TEST_NAME]]"; class A { adapt {}; } class B { adapt A; } @@ -58,7 +58,7 @@ let d: D = {} as D; // --- fail_init_class.carbon -library "fail_init_class"; +library "[[@TEST_NAME]]"; class A { var x: i32; @@ -84,7 +84,7 @@ var b_init: B = ({.x = 1, .y = 2} as A) as B; // --- fail_adapt_init_from_struct.carbon -library "fail_adapt_init_from_struct"; +library "[[@TEST_NAME]]"; class A { var x: i32; diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 0c1861bbeb0f..9442fb697e78 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -9,14 +9,14 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/type_literals.carbon // --- iN.carbon -library "iN"; +library "[[@TEST_NAME]]"; var test_i8: i8; var test_i16: i16; var test_i64: i64; // --- fail_iN_bad_width.carbon -library "fail_iN_bad_width"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Name `i0` not found. // CHECK:STDERR: var test_i0: i0; @@ -46,14 +46,14 @@ var test_i1000000000: i1000000000; var test_i10000000000000000000: i10000000000000000000; // --- uN.carbon -library "uN"; +library "[[@TEST_NAME]]"; var test_u8: u8; var test_u16: u16; var test_u64: u64; // --- fail_uN_bad_width.carbon -library "fail_uN_bad_width"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Name `u0` not found. // CHECK:STDERR: var test_u0: u0; @@ -83,7 +83,7 @@ var test_u1000000000: u1000000000; var test_u10000000000000000000: u10000000000000000000; // --- fail_fN_bad_width.carbon -library "fail_fN_bad_width"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Name `f0` not found. // CHECK:STDERR: var test_f0: f0; @@ -101,7 +101,7 @@ var test_f1000000000: f1000000000; var test_f1000000000000: f1000000000000; // --- fail_fN_todo_unsupported.carbon -library "fail_fN_todo_unsupported"; +library "[[@TEST_NAME]]"; // TODO: Some or all of these should eventually work. // CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+3]]:15: ERROR: Semantics TODO: `Currently only f64 is allowed`. diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index b79e5a9448ec..6856ccb84a71 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -10,13 +10,13 @@ // --- types.carbon -library "types"; +library "[[@TEST_NAME]]"; fn Bool() -> type = "bool.make_type"; // --- use_types.carbon -library "uses_types"; +library "[[@TEST_NAME]]"; import library "types"; diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index fbe274b8531c..08a13df88282 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -10,13 +10,13 @@ // --- types.carbon -library "types"; +library "[[@TEST_NAME]]"; fn Float(size: i32) -> type = "float.make_type"; // --- use_types.carbon -library "uses_types"; +library "[[@TEST_NAME]]"; import library "types"; @@ -28,7 +28,7 @@ fn GetFloat(dyn_size: i32) -> type { // --- fail_invalid_size.carbon -library "invalid_size"; +library "[[@TEST_NAME]]"; import library "types"; diff --git a/toolchain/check/testdata/builtins/int/make_type_32.carbon b/toolchain/check/testdata/builtins/int/make_type_32.carbon index 2f669a90545d..4e922765b1a8 100644 --- a/toolchain/check/testdata/builtins/int/make_type_32.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_32.carbon @@ -10,13 +10,13 @@ // --- types.carbon -library "types"; +library "[[@TEST_NAME]]"; fn Int() -> type = "int.make_type_32"; // --- use_types.carbon -library "uses_types"; +library "[[@TEST_NAME]]"; import library "types"; diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 58d7a6144a77..f6b9b999be52 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -10,13 +10,13 @@ // --- types.carbon -library "types"; +library "[[@TEST_NAME]]"; fn Int(n: i32) -> type = "int.make_type_signed"; // --- use_types.carbon -library "uses_types"; +library "[[@TEST_NAME]]"; import library "types"; @@ -34,7 +34,7 @@ fn Symbolic(N:! i32, x: Int(N)) -> Int(N) { // --- fail_zero_size.carbon -library "fail_zero_size"; +library "[[@TEST_NAME]]"; import library "types"; @@ -46,7 +46,7 @@ var n: Int(0); // --- fail_negative_size.carbon -library "fail_negative_size"; +library "[[@TEST_NAME]]"; import library "types"; @@ -60,7 +60,7 @@ var n: Int(Negate(1)); // --- fail_oversized.carbon -library "fail_oversized"; +library "[[@TEST_NAME]]"; import library "types"; diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index b69d1b7fcab6..806389af6e73 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -10,13 +10,13 @@ // --- types.carbon -library "types"; +library "[[@TEST_NAME]]"; fn UInt(n: i32) -> type = "int.make_type_unsigned"; // --- use_types.carbon -library "uses_types"; +library "[[@TEST_NAME]]"; import library "types"; @@ -34,7 +34,7 @@ fn Symbolic(N:! i32, x: UInt(N)) -> UInt(N) { // --- fail_zero_size.carbon -library "fail_zero_size"; +library "[[@TEST_NAME]]"; import library "types"; @@ -46,7 +46,7 @@ var n: UInt(0); // --- fail_negative_size.carbon -library "fail_negative_size"; +library "[[@TEST_NAME]]"; import library "types"; @@ -60,7 +60,7 @@ var n: UInt(Negate(1)); // --- fail_oversized.carbon -library "fail_oversized"; +library "[[@TEST_NAME]]"; import library "types"; diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 4a70476c144f..424cc4bdfab1 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -10,7 +10,7 @@ // --- fail_private_field_access.carbon -library "private_field_access"; +library "[[@TEST_NAME]]"; class Circle { private var radius: i32; @@ -64,7 +64,7 @@ fn Run() { // --- fail_protected_field_access.carbon -library "protected_field_access"; +library "[[@TEST_NAME]]"; class A { protected var x: i32; @@ -83,7 +83,7 @@ fn Run() { // --- instance_private_field_access_on_self.carbon -library "instance_private_field_access_on_self"; +library "[[@TEST_NAME]]"; class Circle { private var radius: i32; @@ -103,7 +103,7 @@ class Circle { // --- public_global_access.carbon -library "public_global_access"; +library "[[@TEST_NAME]]"; class A { let x: i32 = 5; @@ -113,7 +113,7 @@ let x: i32 = A.x; // --- fail_global_access.carbon -library "global_access"; +library "[[@TEST_NAME]]"; class A { protected let x: i32 = 5; @@ -139,7 +139,7 @@ let y: i32 = A.y; // --- fail_todo_global_self_access.carbon -library "global_self_access"; +library "[[@TEST_NAME]]"; class A { private let internal: i32 = 10; diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index 4e54b53c678d..591e88a635c9 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -10,7 +10,7 @@ // --- basic.carbon -library "basic"; +library "[[@TEST_NAME]]"; class SomeClass { var a: i32; @@ -27,7 +27,7 @@ class StructAdapter { // --- fail_not_extend.carbon -library "fail_not_extend"; +library "[[@TEST_NAME]]"; class Adapted { fn F(); diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 01337950eed2..a191e9cd4d47 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -14,19 +14,19 @@ // --- other_define.carbon -package Other library "define"; +package Other library "[[@TEST_NAME]]"; class C {} // --- other_extern.carbon -package Other library "extern"; +package Other library "[[@TEST_NAME]]"; extern class C; // --- other_conflict.carbon -package Other library "conflict"; +package Other library "[[@TEST_NAME]]"; fn C() {} @@ -36,23 +36,23 @@ fn C() {} // --- define.carbon -library "define"; +library "[[@TEST_NAME]]"; -import Other library "define"; +import Other library "other_define"; var c: Other.C = {}; // --- fail_extern.carbon -library "extern"; +library "[[@TEST_NAME]]"; -import Other library "extern"; +import Other library "other_extern"; // CHECK:STDERR: fail_extern.carbon:[[@LINE+10]]:8: ERROR: Variable has incomplete type `C`. // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_extern.carbon:[[@LINE-5]]:1: In import. -// CHECK:STDERR: import Other library "extern"; +// CHECK:STDERR: import Other library "other_extern"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_extern.carbon:4:1: Class was forward declared here. // CHECK:STDERR: extern class C; @@ -62,22 +62,22 @@ var c: Other.C = {}; // --- fail_todo_merge_define_extern.carbon -library "merge_define_extern"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+12]]:1: In import. -// CHECK:STDERR: import Other library "define"; +// CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_extern.carbon:4:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+6]]:1: In import. -// CHECK:STDERR: import Other library "define"; +// CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_define.carbon:4:1: Name is previously declared here. // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -import Other library "define"; -import Other library "extern"; +import Other library "other_define"; +import Other library "other_extern"; // CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:8: In name lookup for `C`. // CHECK:STDERR: var c: Other.C = {}; @@ -87,22 +87,22 @@ var c: Other.C = {}; // --- fail_conflict.carbon -library "conflict"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. -// CHECK:STDERR: import Other library "define"; +// CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_conflict.carbon:4:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: In import. -// CHECK:STDERR: import Other library "define"; +// CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_define.carbon:4:1: Name is previously declared here. // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -import Other library "define"; -import Other library "conflict"; +import Other library "other_define"; +import Other library "other_conflict"; // CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: In name lookup for `C`. // CHECK:STDERR: var c: Other.C = {}; @@ -231,10 +231,10 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: import Other//define +// CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_define, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -285,9 +285,9 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .C = %import_ref -// CHECK:STDOUT: import Other//extern +// CHECK:STDOUT: import Other//other_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref Other//extern, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref: type = import_ref Other//other_extern, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -336,12 +336,12 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: import Other//define -// CHECK:STDOUT: import Other//extern +// CHECK:STDOUT: import Other//other_define +// CHECK:STDOUT: import Other//other_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//extern, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_extern, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -395,12 +395,12 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: import Other//define -// CHECK:STDOUT: import Other//conflict +// CHECK:STDOUT: import Other//other_define +// CHECK:STDOUT: import Other//other_conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//conflict, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_conflict, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index fdf4b603ff94..54a29e896b28 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -10,7 +10,7 @@ // --- basic.carbon -library "basic"; +library "[[@TEST_NAME]]"; class SomeClassAdapter; @@ -37,7 +37,7 @@ fn TestAdapterMethod(a: SomeClassAdapter) { // --- fail_todo_method_access.carbon -library "fail_todo_method_access"; +library "[[@TEST_NAME]]"; class SomeClass { fn F[self: Self](); @@ -63,7 +63,7 @@ fn F(a: SomeClassAdapter) { // --- fail_todo_field_access.carbon -library "fail_todo_field_access"; +library "[[@TEST_NAME]]"; class SomeClass { var a: i32; @@ -87,7 +87,7 @@ fn F(a: SomeClassAdapter) -> i32 { // --- fail_todo_adapt_non_class.carbon -library "fail_todo_adapt_non_class"; +library "[[@TEST_NAME]]"; class StructAdapter { // CHECK:STDERR: fail_todo_adapt_non_class.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `extending non-class type`. diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index b7447b9219cc..21e0917e8a67 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -10,7 +10,7 @@ // --- fail_not_type.carbon -library "not_type"; +library "[[@TEST_NAME]]"; class Bad { // CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:3: ERROR: Cannot implicitly convert from `i32` to `type`. @@ -31,7 +31,7 @@ fn Use(b: Bad) { b.F(); } // --- fail_extend_not_type.carbon -library "extend_not_type"; +library "[[@TEST_NAME]]"; class Bad { // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+7]]:3: ERROR: Cannot implicitly convert from `i32` to `type`. @@ -49,7 +49,7 @@ fn Use(b: Bad) { b.F(); } // --- fail_repeated.carbon -library "fail_repeated"; +library "[[@TEST_NAME]]"; class MultipleAdapts { adapt (); @@ -77,7 +77,7 @@ class MultipleAdaptsSameType { // --- fail_bad_scope.carbon -library "fail_bad_scope"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:1: ERROR: `adapt` declaration can only be used in a class. // CHECK:STDERR: adapt {}; diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 57256952f3bc..541229b0c955 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -10,7 +10,7 @@ // --- fail_incomplete_type.carbon -library "incomplete_type"; +library "[[@TEST_NAME]]"; class Incomplete; diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index b3976f226adb..55a93872c7a4 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -10,7 +10,7 @@ // --- fail_adapt_with_base.carbon -library "fail_adapt_with_base"; +library "[[@TEST_NAME]]"; base class Base {} @@ -28,7 +28,7 @@ class AdaptWithBase { // --- fail_adapt_with_fields.carbon -library "fail_adapt_with_fields"; +library "[[@TEST_NAME]]"; class AdaptWithField { // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: ERROR: Adapter cannot have fields. @@ -58,7 +58,7 @@ class AdaptWithFields { // --- fail_adapt_with_base_and_fields.carbon -library "fail_adapt_with_base_and_fields"; +library "[[@TEST_NAME]]"; base class Base {} diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 9d6f36c53cd5..6ea845094431 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class Empty { } @@ -19,7 +19,7 @@ class Incomplete; // --- fail_b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index 0faee11b08a4..8b94f35efe4f 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon @@ -10,7 +10,7 @@ // --- fail_add_base.carbon -library "fail_add_base"; +library "[[@TEST_NAME]]"; class A; // CHECK:STDERR: fail_add_base.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. @@ -24,7 +24,7 @@ base class A {} // --- fail_add_abstract.carbon -library "fail_add_abstract"; +library "[[@TEST_NAME]]"; class B; // CHECK:STDERR: fail_add_abstract.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. @@ -38,7 +38,7 @@ abstract class B {} // --- fail_remove_base.carbon -library "fail_remove_base"; +library "[[@TEST_NAME]]"; base class C; // CHECK:STDERR: fail_remove_base.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. @@ -52,7 +52,7 @@ class C {} // --- fail_base_to_abstract.carbon -library "fail_base_to_abstract"; +library "[[@TEST_NAME]]"; base class D; // CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. @@ -66,7 +66,7 @@ abstract class D {} // --- fail_remove_abstract.carbon -library "fail_remove_abstract"; +library "[[@TEST_NAME]]"; abstract class E; // CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. @@ -80,7 +80,7 @@ class E {} // --- fail_abstract_to_base.carbon -library "fail_abstract_to_base"; +library "[[@TEST_NAME]]"; abstract class F; // CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE+6]]:1: ERROR: Class redeclared with different inheritance kind. diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index a9afa1fbf3d1..efc19f532447 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -10,7 +10,7 @@ // --- call.carbon -library "call"; +library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} @@ -21,7 +21,7 @@ var b: Class((), 0); // --- fail_too_few.carbon -library "too_few"; +library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} @@ -36,7 +36,7 @@ var a: Class(i32*); // --- fail_too_many.carbon -library "too_many"; +library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} @@ -51,7 +51,7 @@ var a: Class(i32*, 1, 2); // --- fail_no_conversion.carbon -library "no_conversion"; +library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index c58363b394bb..6a46d3a68dcd 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -10,7 +10,7 @@ // --- foo.carbon -library "foo"; +library "[[@TEST_NAME]]"; class Class(T:! type); @@ -23,7 +23,7 @@ fn F() -> CompleteClass(i32); // --- foo.impl.carbon -impl library "foo"; +impl library "[[@TEST_NAME]]"; class Class(T:! type) { var x: T; @@ -35,7 +35,7 @@ fn F() -> CompleteClass(i32) { // --- use_foo.carbon -library "use_foo"; +library "[[@TEST_NAME]]"; import library "foo"; fn UseMethod() -> i32 { @@ -50,7 +50,7 @@ fn UseField() -> i32 { // --- fail_generic_arg_mismatch.carbon -library "fail_generic_arg_mismatch"; +library "[[@TEST_NAME]]"; import library "foo"; fn Use() { @@ -65,14 +65,14 @@ fn Use() { var v: CompleteClass(i32*) = F(); } -// --- fail_bad_foo.impl.carbon +// --- fail_foo.impl.carbon -impl library "foo"; +impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_bad_foo.impl.carbon:[[@LINE+10]]:13: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+10]]:13: ERROR: Redeclaration differs at parameter 1. // CHECK:STDERR: class Class(U:! type) { // CHECK:STDERR: ^ -// CHECK:STDERR: fail_bad_foo.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE-5]]:6: In import. // CHECK:STDERR: impl library "foo"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: foo.carbon:4:13: Previous declaration's corresponding parameter here. @@ -80,7 +80,7 @@ impl library "foo"; // CHECK:STDERR: ^ // CHECK:STDERR: class Class(U:! type) { - // CHECK:STDERR: fail_bad_foo.impl.carbon:[[@LINE+3]]:10: ERROR: Name `T` not found. + // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:10: ERROR: Name `T` not found. // CHECK:STDERR: var x: T; // CHECK:STDERR: ^ var x: T; @@ -793,7 +793,7 @@ class Class(U:! type) { // CHECK:STDOUT: %.3 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_foo.impl.carbon +// CHECK:STDOUT: --- fail_foo.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %U: type = bind_symbolic_name U 0 [symbolic] diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 5f3e9f428d6a..933b2b4e735a 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -21,7 +21,7 @@ fn InitFromStructGeneric(T:! type, x: T) -> T { // --- fail_todo_init.carbon -library "fail_todo_init"; +library "[[@TEST_NAME]]"; class Class(T:! type) { var k: T; diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 41d8a67bd26d..448f96189d15 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -32,7 +32,7 @@ fn AddrMethodCall(p: Class(i32)*) -> i32 { // --- fail_todo_static_member_fn_call.carbon -library "fail_todo_static_member_fn_call"; +library "[[@TEST_NAME]]"; class Class(T:! type) { fn Make() -> Class(T) { return {}; } diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index cbcbb9968374..19e0e844f642 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -10,7 +10,7 @@ // --- basic.carbon -library "basic"; +library "[[@TEST_NAME]]"; class Class(T:! type) { fn F(n: T) -> T; @@ -28,7 +28,7 @@ fn Class(T:! type).G[self: Self]() -> T { // --- nested.carbon -library "nested"; +library "[[@TEST_NAME]]"; class A(T:! type) { class B(N:! T) { @@ -40,7 +40,7 @@ fn A(T:! type).B(N:! T).F[self: Self](a: T) {} // --- fail_mismatched_not_generic_vs_generic.carbon -library "fail_mismatched_not_generic_vs_generic"; +library "[[@TEST_NAME]]"; class NotGeneric { fn F(); @@ -57,7 +57,7 @@ fn NotGeneric(T:! type).F() {} // --- fail_mismatched_too_few_args.carbon -library "fail_mismatched_too_few_args"; +library "[[@TEST_NAME]]"; class Generic(T:! type) { fn TooFew(); @@ -74,7 +74,7 @@ fn Generic().TooFew() {} // --- fail_mismatched_too_many_args.carbon -library "fail_mismatched_too_many_args"; +library "[[@TEST_NAME]]"; class Generic(T:! type) { fn TooMany(); @@ -91,7 +91,7 @@ fn Generic(T:! type, U:! type).TooMany() {} // --- fail_mismatched_wrong_arg_type.carbon -library "fail_mismatched_wrong_arg_type"; +library "[[@TEST_NAME]]"; class Generic(T:! type) { fn WrongType(); diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index b58e3038ea57..90ccf1b241e1 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -10,7 +10,7 @@ // --- valid.carbon -library "valid"; +library "[[@TEST_NAME]]"; class Generic(T:! type); @@ -19,7 +19,7 @@ class Generic(T:! type) { // --- fail_mismatch_param_list.carbon -library "mismatch_param_list"; +library "[[@TEST_NAME]]"; class A; // CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter list. @@ -33,7 +33,7 @@ class A(T:! type) {} // --- fail_mismatch_implicit_param_list.carbon -library "implicit_mismatch_param_list"; +library "[[@TEST_NAME]]"; class B(N:! i32); // CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of implicit parameter list. @@ -47,7 +47,7 @@ class B[T:! type](N:! T) {} // --- fail_mismatch_param_count.carbon -library "mismatch_param_count"; +library "[[@TEST_NAME]]"; class C(T:! type); // CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 2. @@ -61,7 +61,7 @@ class C(T:! type, U:! i32) {} // --- fail_mismatch_param_type.carbon -library "mismatch_param_type"; +library "[[@TEST_NAME]]"; class D(T:! type); // CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: ERROR: Redeclaration differs at parameter 1. @@ -75,7 +75,7 @@ class D(T:! i32) {} // --- fail_mismatch_param_name.carbon -library "mismatch_param_name"; +library "[[@TEST_NAME]]"; class E(T:! type); // CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: ERROR: Redeclaration differs at parameter 1. diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index beb73d9bc912..7a2855b0823d 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class Empty { } @@ -30,7 +30,7 @@ class Incomplete; // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index d2c3e7ea8ac1..992291e71eea 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; base class Base { fn F[self: Self](); @@ -26,7 +26,7 @@ class Child { // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/class/import_forward_decl.carbon b/toolchain/check/testdata/class/import_forward_decl.carbon index 293b6b261043..68905fe37abe 100644 --- a/toolchain/check/testdata/class/import_forward_decl.carbon +++ b/toolchain/check/testdata/class/import_forward_decl.carbon @@ -10,13 +10,13 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class ForwardDecl; // --- a.impl.carbon -impl library "a"; +impl library "[[@TEST_NAME]]"; class ForwardDecl { } diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index b0208174050b..914f18953639 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -30,13 +30,13 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class C {} // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; @@ -47,7 +47,7 @@ var b_ptr: D* = &b_val; // --- c.carbon -library "c"; +library "[[@TEST_NAME]]"; import library "a"; @@ -62,7 +62,7 @@ var c_ptr: E* = &c_val; // --- triangle.carbon -library "triangle"; +library "[[@TEST_NAME]]"; import library "a"; import library "b"; @@ -72,7 +72,7 @@ var ptr: D* = &val; // --- triangle_reverse.carbon -library "triangle_reverse"; +library "[[@TEST_NAME]]"; import library "b"; import library "a"; @@ -82,7 +82,7 @@ var ptr: D* = &val; // --- diamond.carbon -library "diamond"; +library "[[@TEST_NAME]]"; import library "b"; import library "c"; @@ -92,7 +92,7 @@ var ptr: E* = &val; // --- diamond_reverse.carbon -library "diamond_reverse"; +library "[[@TEST_NAME]]"; import library "c"; import library "b"; diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index 2090c93ffcbb..381d513fc166 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class Cycle { var a: Cycle*; @@ -18,7 +18,7 @@ class Cycle { // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index 1ed83fc5df05..db2e2ee6c67e 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class Cycle; @@ -23,7 +23,7 @@ class Cycle { // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index c083a4437df7..7340aee5492d 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -11,7 +11,7 @@ // --- instance_protected_field_access.carbon -library "instance_protected_field_access"; +library "[[@TEST_NAME]]"; base class Shape { protected var x: i32; @@ -28,7 +28,7 @@ class Circle { // --- shadowing_access.carbon -library "shadowing_access"; +library "[[@TEST_NAME]]"; base class A { fn F(); @@ -46,7 +46,7 @@ base class C { // --- inherited_member_access.carbon -library "inherited_member_access"; +library "[[@TEST_NAME]]"; base class A { protected let SOME_CONSTANT: i32 = 5; @@ -69,7 +69,7 @@ class B { // --- fail_inherited_private_field_access.carbon -library "inherited_private_field_access"; +library "[[@TEST_NAME]]"; base class Shape { private var y: i32; @@ -92,7 +92,7 @@ class Square { // --- noninstance_private_on_self.carbon -library "noninstance_private_on_self"; +library "[[@TEST_NAME]]"; class C { private fn F() {} @@ -101,7 +101,7 @@ class C { // --- noninstance_protected_on_self.carbon -library "noninstance_protected_on_self"; +library "[[@TEST_NAME]]"; class C { protected fn F() {} @@ -110,7 +110,7 @@ class C { // --- fail_noninstance_private_on_parent.carbon -library "noninstance_private_on_parent"; +library "[[@TEST_NAME]]"; base class B { private fn F() {} @@ -130,7 +130,7 @@ class C { // --- noninstance_protected_on_parent.carbon -library "noninstance_protected_on_parent"; +library "[[@TEST_NAME]]"; base class B { protected fn F() {} @@ -143,7 +143,7 @@ class C { // --- fail_non_inherited_access.carbon -library "non_inherited_access"; +library "[[@TEST_NAME]]"; base class A { protected let SOME_PROTECTED_CONSTANT: i32 = 5; diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index e10545ad1f4f..0db2eced5014 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -10,7 +10,7 @@ // --- init_adapt.carbon -library "init_adapt"; +library "[[@TEST_NAME]]"; class C { var a: i32; @@ -37,7 +37,7 @@ var e: C = MakeAdaptC() as C; // --- fail_not_implicit.carbon -library "fail_not_implicit"; +library "[[@TEST_NAME]]"; class C { var a: i32; diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/no_prelude/export_name.carbon index 0855eb093dc2..b8ca11ae3076 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/no_prelude/export_name.carbon @@ -14,13 +14,13 @@ // --- base.carbon -library "base"; +library "[[@TEST_NAME]]"; class C {} // --- export.carbon -library "export"; +library "[[@TEST_NAME]]"; import library "base"; @@ -32,7 +32,7 @@ export C; // --- use_export.carbon -library "use_export"; +library "[[@TEST_NAME]]"; import library "export"; diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 963cc77971ce..5421238e5c03 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -14,25 +14,25 @@ // --- decl.carbon -library "decl"; +library "[[@TEST_NAME]]"; class C; // --- extern_decl.carbon -library "extern_decl"; +library "[[@TEST_NAME]]"; extern class C; // --- extern_decl_copy.carbon -library "extern_decl_copy"; +library "[[@TEST_NAME]]"; extern class C; // --- def.carbon -library "def"; +library "[[@TEST_NAME]]"; class C {} @@ -42,7 +42,7 @@ class C {} // --- fail_decl_fn_in_extern.carbon -library "fail_decl_fn_in_extern"; +library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE+7]]:4: ERROR: Cannot declare a member of incomplete class `C`. @@ -56,13 +56,13 @@ fn C.F(); // --- extern_def.carbon -library "fail_extern_def"; +library "[[@TEST_NAME]]"; extern class C {} // --- fail_extern_decl_after_extern_decl.carbon -library "fail_extern_decl_after_extern_decl"; +library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `class C` is redundant. @@ -76,7 +76,7 @@ extern class C; // --- fail_decl_after_extern_decl.carbon -library "fail_decl_after_extern_decl"; +library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `class C` is redundant. @@ -90,7 +90,7 @@ class C; // --- fail_extern_member_class.carbon -library "fail_extern_member_class"; +library "[[@TEST_NAME]]"; class C { // CHECK:STDERR: fail_extern_member_class.carbon:[[@LINE+4]]:3: ERROR: `extern` not allowed on `class` declaration that is a member. @@ -102,7 +102,7 @@ class C { // --- fail_def_after_extern_decl.carbon -library "fail_def_after_extern_decl"; +library "[[@TEST_NAME]]"; extern class C; // CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `class C` must match use of `extern`. @@ -116,7 +116,7 @@ class C {} // --- fail_extern_decl_after_decl.carbon -library "fail_extern_decl_after_decl"; +library "[[@TEST_NAME]]"; class C; // CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `class C` is redundant. @@ -130,7 +130,7 @@ extern class C; // --- fail_import_extern_decl_then_decl.carbon -library "import_extern_decl_then_decl"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+13]]:1: In import. // CHECK:STDERR: import library "extern_decl"; @@ -150,7 +150,7 @@ import library "decl"; // --- fail_import_decl_then_extern_decl.carbon -library "import_decl_then_extern_decl"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+13]]:1: In import. // CHECK:STDERR: import library "decl"; @@ -170,7 +170,7 @@ import library "extern_decl"; // --- fail_import_extern_decl_then_def.carbon -library "import_extern_decl_then_def"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+13]]:1: In import. // CHECK:STDERR: import library "extern_decl"; @@ -190,7 +190,7 @@ import library "def"; // --- fail_import_ownership_conflict.carbon -library "fail_import_ownership_conflict"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+26]]:1: In import. // CHECK:STDERR: import library "extern_decl"; @@ -224,7 +224,7 @@ import library "def"; // --- fail_todo_import_extern_decl_copy.carbon -library "import_extern_decl_copy"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+13]]:1: In import. // CHECK:STDERR: import library "extern_decl"; @@ -244,7 +244,7 @@ import library "extern_decl_copy"; // --- fail_extern_decl_after_import_extern_decl.carbon -library "extern_decl_after_import_extern_decl"; +library "[[@TEST_NAME]]"; import library "extern_decl"; @@ -262,7 +262,7 @@ extern class C; // --- fail_decl_after_import_extern_decl.carbon -library "decl_after_import_extern_decl"; +library "[[@TEST_NAME]]"; import library "decl"; @@ -280,7 +280,7 @@ extern class C; // --- fail_def_after_import_extern_decl.carbon -library "def_after_import_extern_decl"; +library "[[@TEST_NAME]]"; import library "def"; @@ -298,7 +298,7 @@ extern class C; // --- fail_extern_decl_after_import_def.carbon -library "extern_decl_after_import_def"; +library "[[@TEST_NAME]]"; import library "def"; diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index 2dda4ffdad71..b6737a85803d 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -10,7 +10,7 @@ // --- params.carbon -library "params"; +library "[[@TEST_NAME]]"; class NotGenericNoParams {} class NotGenericButParams() {} @@ -31,7 +31,7 @@ var e: C(X).GenericAndParams(X) = {}; // --- fail_non_generic_implicit_params.carbon -library "non_generic_implicit_params"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:9: ERROR: Parameters of generic types must be constant. // CHECK:STDERR: class A[T: type]() {} @@ -41,7 +41,7 @@ class A[T: type]() {} // --- fail_non_generic_params.carbon -library "non_generic_params"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: ERROR: Parameters of generic types must be constant. // CHECK:STDERR: class A(T: type) {} diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 2bffb4e50cf4..77307c43beaa 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -10,25 +10,25 @@ // --- basic.carbon -library "basic"; +library "[[@TEST_NAME]]"; class C; // --- basic.impl.carbon -impl library "basic"; +impl library "[[@TEST_NAME]]"; class C {} // --- redecl_after_def.carbon -library "redecl_after_def"; +library "[[@TEST_NAME]]"; class C {} // --- fail_redecl_after_def.impl.carbon -impl library "redecl_after_def"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `class C` is redundant. // CHECK:STDERR: class C; @@ -44,13 +44,13 @@ class C; // --- redef_after_def.carbon -library "redef_after_def"; +library "[[@TEST_NAME]]"; class C {} // --- fail_redef_after_def.impl.carbon -impl library "redef_after_def"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redefinition of `class C`. // CHECK:STDERR: class C {} @@ -66,14 +66,14 @@ class C {} // --- def_alias.carbon -library "def_alias"; +library "[[@TEST_NAME]]"; class C; alias B = C; // --- fail_def_alias.impl.carbon -impl library "def_alias"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: class B {} diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 2ba82b59ed51..834663ed469b 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -14,13 +14,13 @@ // --- def.carbon -package Test library "def"; +package Test library "[[@TEST_NAME]]"; private class Def {} // --- forward_with_def.carbon -package Test library "forward_with_def"; +package Test library "[[@TEST_NAME]]"; private class ForwardWithDef; @@ -28,7 +28,7 @@ class ForwardWithDef {} // --- forward.carbon -package Test library "forward"; +package Test library "[[@TEST_NAME]]"; private class Forward; @@ -38,13 +38,13 @@ private class Forward; // --- def.impl.carbon -impl package Test library "def"; +impl package Test library "[[@TEST_NAME]]"; var c: Def = {}; // --- fail_local_def.carbon -package Test library "fail_local_def"; +package Test library "[[@TEST_NAME]]"; import library "def"; @@ -56,7 +56,7 @@ var c: Def = {}; // --- fail_other_def.carbon -package Other library "fail_other_def"; +package Other library "[[@TEST_NAME]]"; import Test library "def"; @@ -68,13 +68,13 @@ var c: Test.Def = {}; // --- forward_with_def.impl.carbon -impl package Test library "forward_with_def"; +impl package Test library "[[@TEST_NAME]]"; var c: ForwardWithDef = {}; // --- fail_local_forward_with_def.carbon -package Test library "fail_local_forward_with_def"; +package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; @@ -86,7 +86,7 @@ var c: ForwardWithDef = {}; // --- fail_other_forward_with_def.carbon -package Other library "fail_other_forward_with_def"; +package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; @@ -98,7 +98,7 @@ var c: Test.ForwardWithDef = {}; // --- forward.impl.carbon -impl package Test library "forward"; +impl package Test library "[[@TEST_NAME]]"; fn F(c: Forward*) {} @@ -106,7 +106,7 @@ class Forward {} // --- fail_local_forward.carbon -package Test library "fail_local_forward"; +package Test library "[[@TEST_NAME]]"; import library "forward"; @@ -118,7 +118,7 @@ fn F(c: Forward*) {} // --- fail_other_forward.carbon -package Other library "fail_other_forward"; +package Other library "[[@TEST_NAME]]"; import Test library "forward"; @@ -129,7 +129,7 @@ fn F(c: Test.Forward*) {} // --- todo_fail_private_on_redecl.carbon -library "fail_private_on_redecl"; +library "[[@TEST_NAME]]"; private class Redecl; diff --git a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon index d906dc5732d9..af61a15e308d 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon @@ -14,7 +14,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; class C { fn F() {} @@ -22,13 +22,13 @@ class C { // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; export import library "a"; // --- c.carbon -library "c"; +library "[[@TEST_NAME]]"; import library "b"; @@ -36,13 +36,13 @@ export C; // --- d.carbon -library "d"; +library "[[@TEST_NAME]]"; export import library "c"; // --- e.carbon -library "e"; +library "[[@TEST_NAME]]"; import library "c"; @@ -52,7 +52,7 @@ class D { // --- f.carbon -library "f"; +library "[[@TEST_NAME]]"; export import library "e"; @@ -62,7 +62,7 @@ export import library "e"; // --- use_b.carbon -library "use_b"; +library "[[@TEST_NAME]]"; import library "b"; @@ -70,7 +70,7 @@ var x: () = C.F(); // --- use_c.carbon -library "use_c"; +library "[[@TEST_NAME]]"; import library "c"; @@ -78,7 +78,7 @@ var x: () = C.F(); // --- use_d.carbon -library "use_d"; +library "[[@TEST_NAME]]"; import library "d"; @@ -86,7 +86,7 @@ var x: () = C.F(); // --- use_e.carbon -library "use_e"; +library "[[@TEST_NAME]]"; import library "e"; @@ -94,7 +94,7 @@ var x: () = D.C.F(); // --- use_f.carbon -library "use_f"; +library "[[@TEST_NAME]]"; import library "f"; diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index 682585aaed88..0c80529c8859 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -10,13 +10,13 @@ // --- decl_in_api_definition_in_impl.carbon -library "decl_in_api_definition_in_impl"; +library "[[@TEST_NAME]]"; class A; // --- decl_in_api_definition_in_impl.impl.carbon -impl library "decl_in_api_definition_in_impl"; +impl library "[[@TEST_NAME]]"; class A; @@ -24,33 +24,33 @@ class 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]]"; class 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]]"; class 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: class C; @@ -60,11 +60,11 @@ class 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: class D; diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index f67e6bf31d56..41ed1f25fac8 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -10,7 +10,7 @@ // --- basic.carbon -library "basic"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -23,7 +23,7 @@ class Bar(a:! D) {} // --- spacing.carbon -library "spacing"; +library "[[@TEST_NAME]]"; class C {} @@ -32,7 +32,7 @@ class Foo[](a:! C) {} // --- fail_parens.carbon -library "parens"; +library "[[@TEST_NAME]]"; class C {} @@ -48,7 +48,7 @@ class Foo(a:! (C)) {} // --- todo_fail_raw_identifier.carbon -library "raw_identifier"; +library "[[@TEST_NAME]]"; class C {} @@ -57,7 +57,7 @@ class Foo(a:! r#C) {} // --- two_file.carbon -library "two_file"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -67,14 +67,14 @@ class Bar(a:! D); // --- two_file.impl.carbon -impl library "two_file"; +impl library "[[@TEST_NAME]]"; class Foo(a:! C) {} class Bar(a:! D) {} // --- fail_name_mismatch.carbon -library "name_mismatch"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -91,7 +91,7 @@ class Foo(b:! D) {} // --- fail_alias.carbon -library "alias"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -108,7 +108,7 @@ class Foo(a:! D) {} // --- fail_deduced_alias.carbon -library "deduced_alias"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -125,7 +125,7 @@ class Foo[a:! D]() {} // --- alias_two_file.carbon -library "alias_two_file"; +library "[[@TEST_NAME]]"; class C {} @@ -133,7 +133,7 @@ class Foo(a:! C); // --- todo_fail_alias_two_file.impl.carbon -impl library "alias_two_file"; +impl library "[[@TEST_NAME]]"; alias D = C; @@ -141,7 +141,7 @@ class Foo(a:! D) {} // --- fail_repeat_const.carbon -library "repeat_const"; +library "[[@TEST_NAME]]"; class C {} @@ -161,7 +161,7 @@ class Foo(a:! const (const C)) {} // --- fail_self_type.carbon -library "self_type"; +library "[[@TEST_NAME]]"; base class Base { var a: (); diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index c3b47fe58952..c094d11ec98a 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -10,14 +10,14 @@ // --- core.carbon -package Core library "test"; +package Core library "[[@TEST_NAME]]"; fn Int32() -> type = "int.make_type_32"; fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd"; // --- use.carbon -import Core library "test"; +import Core library "core"; var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); @@ -83,10 +83,10 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.1 // CHECK:STDOUT: .TestAdd = %import_ref.2 -// CHECK:STDOUT: import Core//test +// CHECK:STDOUT: import Core//core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//test, inst+2, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//test, inst+20, loaded [template = constants.%TestAdd] +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//core, inst+2, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+20, loaded [template = constants.%TestAdd] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index be9c1c22bb1e..8334c3746b9a 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -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"; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon index 16fabc0b5348..0bd4c2bf2de7 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon @@ -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"; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index f38008f36a59..02d0af65de14 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -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. diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index e8dccc98a479..d93da6b5c442 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -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"; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon index 73f0323ad625..005fe76642c3 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon @@ -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; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon index e97fbe574a3d..8b2219a8e2ec 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon @@ -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"; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index b55884ab7b38..536848dd469c 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -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 { diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon index 756254ffc94f..1aaaf4d99669 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon @@ -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: ^~~~~~~~~~ diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon index 89f037ad9ea9..b88bb4446cc6 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon @@ -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(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon index edaa755ea5be..5a2ed6d02e46 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon @@ -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(); diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 97bbcedaa1d8..f01f46570fac 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -14,7 +14,7 @@ // --- fns.carbon -library "fns"; +library "[[@TEST_NAME]]"; fn A() {} fn B(b: i32) -> i32 { return b; } @@ -23,7 +23,7 @@ fn D(); // --- extern.carbon -library "extern"; +library "[[@TEST_NAME]]"; extern fn A(); @@ -33,7 +33,7 @@ extern fn A(); // --- basics.carbon -library "basics"; +library "[[@TEST_NAME]]"; import library "fns"; @@ -43,7 +43,7 @@ var c: {.c: i32} = C((1,)); // --- fail_def_ownership.carbon -library "def_ownership"; +library "[[@TEST_NAME]]"; import library "fns"; @@ -72,7 +72,7 @@ fn B(b: i32) -> i32; // --- fail_redecl_then_def.carbon -library "redecl_then_def"; +library "[[@TEST_NAME]]"; import library "extern"; @@ -102,7 +102,7 @@ fn A() {} // --- fail_mix_extern_decl.carbon -library "mix_extern_decl"; +library "[[@TEST_NAME]]"; import library "fns"; diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 5eebe99db939..4209af15f694 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -14,13 +14,13 @@ // --- def.carbon -package Test library "def"; +package Test library "[[@TEST_NAME]]"; private fn Def() {} // --- forward_with_def.carbon -package Test library "forward_with_def"; +package Test library "[[@TEST_NAME]]"; private fn ForwardWithDef(); @@ -28,7 +28,7 @@ fn ForwardWithDef() {} // --- forward.carbon -package Test library "forward"; +package Test library "[[@TEST_NAME]]"; private fn Forward(); @@ -38,13 +38,13 @@ private fn Forward(); // --- def.impl.carbon -impl package Test library "def"; +impl package Test library "[[@TEST_NAME]]"; var f: () = Def(); // --- fail_local_def.carbon -package Test library "fail_local_def"; +package Test library "[[@TEST_NAME]]"; import library "def"; @@ -56,7 +56,7 @@ var f: () = Def(); // --- fail_other_def.carbon -package Other library "fail_other_def"; +package Other library "[[@TEST_NAME]]"; import Test library "def"; @@ -68,13 +68,13 @@ var f: () = Test.Def(); // --- forward_with_def.impl.carbon -impl package Test library "forward_with_def"; +impl package Test library "[[@TEST_NAME]]"; var f: () = ForwardWithDef(); // --- fail_local_forward_with_def.carbon -package Test library "fail_local_forward_with_def"; +package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; @@ -86,7 +86,7 @@ var f: () = ForwardWithDef(); // --- fail_other_forward_with_def.carbon -package Other library "fail_other_forward_with_def"; +package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; @@ -98,7 +98,7 @@ var f: () = Test.ForwardWithDef(); // --- forward.impl.carbon -impl package Test library "forward"; +impl package Test library "[[@TEST_NAME]]"; var f: () = Forward(); @@ -106,7 +106,7 @@ fn Forward() {} // --- fail_local_forward.carbon -package Test library "fail_local_forward"; +package Test library "[[@TEST_NAME]]"; import library "forward"; @@ -118,7 +118,7 @@ var f: () = Forward(); // --- fail_other_forward.carbon -package Other library "fail_other_forward"; +package Other library "[[@TEST_NAME]]"; import Test library "forward"; @@ -129,7 +129,7 @@ var f: () = Test.Forward(); // --- todo_fail_private_on_redecl.carbon -library "fail_private_on_redecl"; +library "[[@TEST_NAME]]"; private fn Redecl(); diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon index f0514fe0b632..cb3c0e0c4589 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon @@ -10,32 +10,32 @@ // --- extern_def.carbon -library "extern_def"; +library "[[@TEST_NAME]]"; extern fn F() {} // --- def_for_extern_decl.carbon -library "def_for_extern_decl"; +library "[[@TEST_NAME]]"; extern fn F(); extern fn F() {} // --- split_library.carbon -library "split_library"; +library "[[@TEST_NAME]]"; extern fn F(); // --- split_library.impl.carbon -impl library "split_library"; +impl library "[[@TEST_NAME]]"; extern fn F() {} // --- fail_def_extern_mismatch.carbon -library "def_extern_mismatch"; +library "[[@TEST_NAME]]"; extern fn F(); // CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. @@ -49,7 +49,7 @@ fn F() {} // --- fail_def_extern_mismatch_reverse.carbon -library "def_extern_mismatch_reverse"; +library "[[@TEST_NAME]]"; fn F(); // CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. @@ -63,7 +63,7 @@ extern fn F() {} // --- fail_extern_diag_suppressed.carbon -library "extern_diag_suppressed"; +library "[[@TEST_NAME]]"; extern fn F(); // CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant. @@ -85,7 +85,7 @@ fn F() {} // --- fail_extern_decl_after_def.carbon -library "extern_decl_after_def"; +library "[[@TEST_NAME]]"; fn F() {} // CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant. @@ -99,11 +99,11 @@ extern fn F(); // --- in_impl.carbon -library "in_impl"; +library "[[@TEST_NAME]]"; // --- fail_in_impl.impl.carbon -impl library "in_impl"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: `extern` entities must have a declaration in the API file. // CHECK:STDERR: extern fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon index 9f086121faba..fc1be380eabd 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon @@ -10,49 +10,49 @@ // --- one_file_extern.carbon -library "one_file_extern"; +library "[[@TEST_NAME]]"; extern library "one_file" fn F(); // --- one_file.carbon -library "one_file"; +library "[[@TEST_NAME]]"; extern fn F() {} // --- two_file_extern.carbon -library "two_file_extern"; +library "[[@TEST_NAME]]"; extern library "two_file" fn F(); // --- two_file.carbon -library "two_file"; +library "[[@TEST_NAME]]"; extern fn F(); // --- two_file.impl.carbon -impl library "two_file"; +impl library "[[@TEST_NAME]]"; extern fn F() {} // --- two_file_impl_mismatch_extern.carbon -library "two_file_impl_mismatch_extern"; +library "[[@TEST_NAME]]"; extern library "two_file_impl_mismatch" fn F(); // --- two_file_impl_mismatch.carbon -library "two_file_impl_mismatch"; +library "[[@TEST_NAME]]"; extern fn F(); // --- fail_two_file_impl_mismatch.impl.carbon -impl library "two_file_impl_mismatch"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. // CHECK:STDERR: fn F() {} @@ -68,19 +68,19 @@ fn F() {} // --- indirect_two_file_extern.carbon -library "indirect_two_file_extern"; +library "[[@TEST_NAME]]"; extern library "indirect_two_file" fn F(); // --- indirect_two_file.carbon -library "indirect_two_file"; +library "[[@TEST_NAME]]"; import library "indirect_two_file_extern"; // --- fail_indirect_two_file.impl.carbon -impl library "indirect_two_file"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: ERROR: `extern` entities must have a declaration in the API file. // CHECK:STDERR: extern fn F() {} @@ -90,17 +90,17 @@ extern fn F() {} // --- in_impl_extern.carbon -library "in_impl_extern"; +library "[[@TEST_NAME]]"; extern library "in_impl" fn F(); // --- in_impl.carbon -library "in_impl"; +library "[[@TEST_NAME]]"; // --- fail_in_impl.impl.carbon -impl library "in_impl"; +impl library "[[@TEST_NAME]]"; import library "in_impl_extern"; diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 4cc0a287d82d..260461b990fc 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -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+10]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. // CHECK:STDERR: fn A() {} @@ -44,13 +44,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+10]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. // CHECK:STDERR: extern fn A() {} @@ -66,13 +66,13 @@ extern fn A() {} // --- redecl_after_def.carbon -library "redecl_after_def"; +library "[[@TEST_NAME]]"; fn A() {} // --- fail_redecl_after_def.impl.carbon -impl library "redecl_after_def"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `fn A` is redundant. // CHECK:STDERR: fn A(); @@ -88,13 +88,13 @@ fn A(); // --- redef_after_def.carbon -library "redef_after_def"; +library "[[@TEST_NAME]]"; fn A() {} // --- fail_redef_after_def.impl.carbon -impl library "redef_after_def"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redefinition of `fn A`. // CHECK:STDERR: fn A() {} @@ -110,14 +110,14 @@ fn A() {} // --- def_alias.carbon -library "def_alias"; +library "[[@TEST_NAME]]"; fn A(); alias B = A; // --- fail_def_alias.impl.carbon -impl library "def_alias"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: fn B() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index bc081cd81500..586845e52117 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -10,7 +10,7 @@ // --- basic.carbon -library "basic"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -23,7 +23,7 @@ fn Bar(a: D) {} // --- spacing.carbon -library "spacing"; +library "[[@TEST_NAME]]"; class C {} @@ -32,7 +32,7 @@ fn Foo[](a: C) {} // --- fail_parens.carbon -library "parens"; +library "[[@TEST_NAME]]"; class C {} @@ -48,7 +48,7 @@ fn Foo(a: (C)) {} // --- todo_fail_raw_identifier.carbon -library "raw_identifier"; +library "[[@TEST_NAME]]"; class C {} @@ -57,7 +57,7 @@ fn Foo(a: r#C) {} // --- two_file.carbon -library "two_file"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -67,14 +67,14 @@ fn Bar(a: D); // --- two_file.impl.carbon -impl library "two_file"; +impl library "[[@TEST_NAME]]"; fn Foo(a: C) {} fn Bar(a: D) {} // --- fail_name_mismatch.carbon -library "name_mismatch"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -91,7 +91,7 @@ fn Foo(b: D) {} // --- fail_alias.carbon -library "alias"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -108,7 +108,7 @@ fn Foo(a: D) {} // --- fail_deduced_alias.carbon -library "deduced_alias"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -125,7 +125,7 @@ fn Foo[a: D]() {} // --- todo_fail_alias_in_return.carbon -library "alias_in_return"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -135,7 +135,7 @@ fn Foo() -> D { return {}; } // --- alias_two_file.carbon -library "alias_two_file"; +library "[[@TEST_NAME]]"; class C {} @@ -143,7 +143,7 @@ fn Foo(a: C); // --- todo_fail_alias_two_file.impl.carbon -impl library "alias_two_file"; +impl library "[[@TEST_NAME]]"; alias D = C; @@ -151,7 +151,7 @@ fn Foo(a: D) {} // --- fail_repeat_const.carbon -library "repeat_const"; +library "[[@TEST_NAME]]"; class C {} diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 88e3c9be84fd..a55ccec7221a 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -10,7 +10,7 @@ // --- deduce_explicit.carbon -library "deduce_explicit"; +library "[[@TEST_NAME]]"; fn ExplicitGenericParam(T:! type) -> T*; @@ -24,7 +24,7 @@ fn CallExplicitGenericParamWithGenericArg(T:! type) -> {.a: T}* { // --- fail_todo_explicit_vs_deduced.carbon -library "fail_todo_explicit_vs_deduced"; +library "[[@TEST_NAME]]"; class A {} @@ -44,7 +44,7 @@ fn CallExplicitAndAlsoDeduced(n: i32) -> i32* { // --- fail_todo_deduce_implicit.carbon -library "fail_todo_deduce_implicit"; +library "[[@TEST_NAME]]"; fn ImplicitGenericParam[T:! type](x: T) -> T*; @@ -58,7 +58,7 @@ fn CallImplicitGenericParam(n: i32) -> i32* { // --- fail_todo_deduce_nested.carbon -library "fail_todo_deduce_nested"; +library "[[@TEST_NAME]]"; fn TupleParam[T:! type](x: (T, i32)); @@ -88,7 +88,7 @@ fn CallStructParam() { // --- fail_deduce_incomplete.carbon -library "fail_deduce_incomplete"; +library "[[@TEST_NAME]]"; // TODO: It would be nice to diagnose this at its point of declaration, because // U is not deducible. @@ -107,7 +107,7 @@ fn CallImplicitNotDeducible() { // --- fail_deduce_inconsistent.carbon -library "fail_deduce_inconsistent"; +library "[[@TEST_NAME]]"; fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index ce08992c920c..72e363c2c23a 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -10,7 +10,7 @@ // --- redeclare.carbon -library "redeclare"; +library "[[@TEST_NAME]]"; fn F(T:! type) -> T*; @@ -20,7 +20,7 @@ fn F(T:! type) -> T* { // --- fail_different_return_type.carbon -library "fail_different_return_type"; +library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; @@ -46,7 +46,7 @@ fn F(T:! type, U:! type) -> U* { // --- fail_reorder.carbon -library "fail_reorder"; +library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; @@ -70,7 +70,7 @@ fn F(U:! type, T:! type) -> T* { // --- fail_rename.carbon -library "fail_rename"; +library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index aaa75463106d..4cdc5db9d8ae 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; interface Add { fn Op[self: Self](other: Self) -> Self; @@ -18,7 +18,7 @@ interface Add { // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 2adcafe26b57..0fd44514e684 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -10,7 +10,7 @@ // --- action.carbon -library "action"; +library "[[@TEST_NAME]]"; interface Action(T:! type) { fn Op(); @@ -28,13 +28,13 @@ fn F(a: A) { a.(Action(B).Op)(); } // --- action.impl.carbon -impl library "action"; +impl library "[[@TEST_NAME]]"; fn G(a: A) { a.(Action(B).Op)(); } // --- fail_action.impl.carbon -impl library "action"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: ERROR: Cannot access member of interface `Action` in type `A` that does not implement that interface. // CHECK:STDERR: fn G(a: A) { a.(Action(C).Op)(); } @@ -44,7 +44,7 @@ fn G(a: A) { a.(Action(C).Op)(); } // --- factory.carbon -library "factory"; +library "[[@TEST_NAME]]"; interface Factory(T:! type) { fn Make() -> T; @@ -59,7 +59,7 @@ impl A as Factory(B) { // --- factory.impl.carbon -impl library "factory"; +impl library "[[@TEST_NAME]]"; fn MakeB(a: A) -> B { return a.(Factory(B).Make)(); @@ -67,7 +67,7 @@ fn MakeB(a: A) -> B { // --- fail_factory.impl.carbon -impl library "factory"; +impl library "[[@TEST_NAME]]"; class C {} diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index ffe2e09b8b35..c0462d46c21b 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -10,7 +10,7 @@ // --- decl_in_api_definition_in_impl.carbon -library "decl_in_api_definition_in_impl"; +library "[[@TEST_NAME]]"; interface A {}; @@ -18,7 +18,7 @@ impl () as A; // --- decl_in_api_definition_in_impl.impl.carbon -impl library "decl_in_api_definition_in_impl"; +impl library "[[@TEST_NAME]]"; impl () as A; @@ -26,17 +26,17 @@ impl () as 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]]"; interface B {}; @@ -44,11 +44,11 @@ impl () as 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]]"; interface C {}; @@ -56,7 +56,7 @@ impl () as 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: impl () as C; @@ -66,11 +66,11 @@ impl () as 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]]"; interface D {}; diff --git a/toolchain/check/testdata/interface/no_prelude/export_name.carbon b/toolchain/check/testdata/interface/no_prelude/export_name.carbon index f887b2e6ed94..2b80aa713a74 100644 --- a/toolchain/check/testdata/interface/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/interface/no_prelude/export_name.carbon @@ -14,13 +14,13 @@ // --- base.carbon -library "base"; +library "[[@TEST_NAME]]"; interface I {} // --- export.carbon -library "export"; +library "[[@TEST_NAME]]"; import library "base"; @@ -32,7 +32,7 @@ export I; // --- use_export.carbon -library "use_export"; +library "[[@TEST_NAME]]"; import library "export"; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon index 9d12af0de493..bb460f9bb5ab 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon @@ -10,13 +10,13 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; interface I; // --- fail_b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; // CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index fb4f1a1b2339..8cc289584969 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -10,7 +10,7 @@ // --- fail_redefine_without_dependents.carbon -library "redefine_without_dependents"; +library "[[@TEST_NAME]]"; interface Interface { } @@ -27,7 +27,7 @@ interface Interface { // --- fail_redefine_with_dependents.carbon -library "redefine_with_dependents"; +library "[[@TEST_NAME]]"; interface Interface {} @@ -44,7 +44,7 @@ interface Interface { // --- fail_name_conflict_with_fn.carbon -library "name_conflict"; +library "[[@TEST_NAME]]"; fn Function(); diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index 35d8f4d9f5bf..040136ef8c65 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -10,7 +10,7 @@ // --- generic.carbon -library "generic"; +library "[[@TEST_NAME]]"; interface Simple(T:! type) {} @@ -39,7 +39,7 @@ fn Pass(T:! Simple(C)) { // --- fail_mismatched_args.carbon -library "fail_mismatched_args"; +library "[[@TEST_NAME]]"; interface Generic(T:! type) {} diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 6f3454a9fad6..ff4116ab2212 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; interface AddWith(T:! type) { fn F(); @@ -18,7 +18,7 @@ interface AddWith(T:! type) { // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; class C {} diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index 48b8de914e92..8dc3b040eb42 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -10,7 +10,7 @@ // --- params.carbon -library "params"; +library "[[@TEST_NAME]]"; interface NotGenericNoParams {} interface NotGenericButParams() {} @@ -30,7 +30,7 @@ impl X as C(X).GenericAndParams(X) {} // --- fail_non_generic_implicit_params.carbon -library "non_generic_implicit_params"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:13: ERROR: Parameters of generic types must be constant. // CHECK:STDERR: interface A[T: type]() {} @@ -40,7 +40,7 @@ interface A[T: type]() {} // --- fail_non_generic_params.carbon -library "non_generic_params"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:13: ERROR: Parameters of generic types must be constant. // CHECK:STDERR: interface A(T: type) {} diff --git a/toolchain/check/testdata/interface/no_prelude/import.carbon b/toolchain/check/testdata/interface/no_prelude/import.carbon index 88dd7d7ccdee..345b7543cde6 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import.carbon @@ -10,7 +10,7 @@ // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; interface Empty { } @@ -32,7 +32,7 @@ var f_ref: {.f: ForwardDeclared}; // --- b.carbon -library "b"; +library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index 508e65a8af66..80ba60b6b75a 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -14,13 +14,13 @@ // --- def.carbon -package Test library "def"; +package Test library "[[@TEST_NAME]]"; private interface Def {} // --- forward_with_def.carbon -package Test library "forward_with_def"; +package Test library "[[@TEST_NAME]]"; private interface ForwardWithDef; @@ -28,7 +28,7 @@ interface ForwardWithDef {} // --- forward.carbon -package Test library "forward"; +package Test library "[[@TEST_NAME]]"; // TODO: Import of forward declared interfaces crashes. // private interface Forward; @@ -39,13 +39,13 @@ package Test library "forward"; // --- def.impl.carbon -impl package Test library "def"; +impl package Test library "[[@TEST_NAME]]"; fn F(i: Def) {} // --- fail_local_def.carbon -package Test library "fail_local_def"; +package Test library "[[@TEST_NAME]]"; import library "def"; @@ -57,7 +57,7 @@ fn F(i: Def) {} // --- fail_other_def.carbon -package Other library "fail_other_def"; +package Other library "[[@TEST_NAME]]"; import Test library "def"; @@ -69,13 +69,13 @@ fn F(i: Test.Def) {} // --- forward_with_def.impl.carbon -impl package Test library "forward_with_def"; +impl package Test library "[[@TEST_NAME]]"; fn F(i: ForwardWithDef) {} // --- fail_local_forward_with_def.carbon -package Test library "fail_local_forward_with_def"; +package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; @@ -87,7 +87,7 @@ fn F(i: ForwardWithDef) {} // --- fail_other_forward_with_def.carbon -package Other library "fail_other_forward_with_def"; +package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; @@ -99,7 +99,7 @@ fn F(i: Test.ForwardWithDef) {} // --- fail_todo_forward.impl.carbon -impl package Test library "forward"; +impl package Test library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+4]]:9: ERROR: Name `Forward` not found. // CHECK:STDERR: fn F(i: Forward*) {} @@ -111,7 +111,7 @@ interface Forward {} // --- fail_local_forward.carbon -package Test library "fail_local_forward"; +package Test library "[[@TEST_NAME]]"; import library "forward"; @@ -123,7 +123,7 @@ fn F(i: Forward*) {} // --- fail_other_forward.carbon -package Other library "fail_other_forward"; +package Other library "[[@TEST_NAME]]"; import Test library "forward"; @@ -134,7 +134,7 @@ fn F(i: Forward*) {} // --- todo_fail_private_on_redecl.carbon -library "fail_private_on_redecl"; +library "[[@TEST_NAME]]"; private interface Redecl; diff --git a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon index 4d91fdb32976..4fef8b10b8b3 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon // --- a.carbon -library "a"; +library "[[@TEST_NAME]]"; interface A; impl () as A; // --- a.impl.carbon -impl library "a"; +impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index ff58258957de..c39b34c63618 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -10,7 +10,7 @@ // --- basic.carbon -library "basic"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -23,7 +23,7 @@ interface Bar(a:! D) {} // --- spacing.carbon -library "spacing"; +library "[[@TEST_NAME]]"; class C {} @@ -32,7 +32,7 @@ interface Foo[](a:! C) {} // --- fail_parens.carbon -library "parens"; +library "[[@TEST_NAME]]"; class C {} @@ -48,7 +48,7 @@ interface Foo(a:! (C)) {} // --- todo_fail_raw_identifier.carbon -library "raw_identifier"; +library "[[@TEST_NAME]]"; class C {} @@ -57,7 +57,7 @@ interface Foo(a:! r#C) {} // --- two_file.carbon -library "two_file"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -67,7 +67,7 @@ interface Bar(a:! D); // --- fail_todo_two_file.impl.carbon -impl library "two_file"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: interface Foo(a:! C) {} @@ -94,7 +94,7 @@ interface Bar(a:! D) {} // --- fail_name_mismatch.carbon -library "name_mismatch"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -111,7 +111,7 @@ interface Foo(b:! D) {} // --- fail_alias.carbon -library "alias"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -128,7 +128,7 @@ interface Foo(a:! D) {} // --- fail_deduced_alias.carbon -library "deduced_alias"; +library "[[@TEST_NAME]]"; class C {} alias D = C; @@ -145,7 +145,7 @@ interface Foo[a:! D]() {} // --- alias_two_file.carbon -library "alias_two_file"; +library "[[@TEST_NAME]]"; class C {} @@ -153,7 +153,7 @@ interface Foo(a:! C); // --- fail_alias_two_file.impl.carbon -impl library "alias_two_file"; +impl library "[[@TEST_NAME]]"; alias D = C; @@ -174,7 +174,7 @@ interface Foo(a:! D) {} // --- fail_repeat_const.carbon -library "repeat_const"; +library "[[@TEST_NAME]]"; class C {} diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index 8e20b64e2488..17f4123e6c60 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -14,7 +14,7 @@ // --- def.carbon -package Test library "def"; +package Test library "[[@TEST_NAME]]"; private let v: () = (); @@ -24,13 +24,13 @@ private let v: () = (); // --- def.impl.carbon -impl package Test library "def"; +impl package Test library "[[@TEST_NAME]]"; let v2: () = v; // --- fail_local_def.carbon -package Test library "fail_local_def"; +package Test library "[[@TEST_NAME]]"; import library "def"; @@ -42,7 +42,7 @@ let v2: () = v; // --- fail_other_def.carbon -package Other library "fail_other_def"; +package Other library "[[@TEST_NAME]]"; import Test library "def"; diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index 843908778fb2..a7c2d07ef2e0 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -10,7 +10,7 @@ // --- namespace.carbon -package Example library "namespace"; +package Example library "[[@TEST_NAME]]"; namespace NS; diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index 2be1c3192b80..3dbd62b6d9c2 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -10,7 +10,7 @@ // --- namespace.carbon -package Example library "namespace"; +package Example library "[[@TEST_NAME]]"; namespace NS; diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 753adbfce1e9..7720ced879de 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -10,7 +10,7 @@ // --- fn.carbon -package Example library "fn"; +package Example library "[[@TEST_NAME]]"; fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index c432e599951a..f2f2a4f93038 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -10,20 +10,20 @@ // --- namespace.carbon -package Example library "namespace"; +package Example library "[[@TEST_NAME]]"; namespace NS; fn NS.Foo() {} // --- fn.carbon -package Example library "fn"; +package Example library "[[@TEST_NAME]]"; fn NS() {} // --- fail_conflict.carbon -package Example library "namespace_then_fn"; +package Example library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. // CHECK:STDERR: import library "namespace"; diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index d39c1411394f..5a4bdcf6c2a8 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -10,20 +10,20 @@ // --- fn.carbon -package Example library "fn"; +package Example library "[[@TEST_NAME]]"; fn NS() {} // --- namespace.carbon -package Example library "namespace"; +package Example library "[[@TEST_NAME]]"; namespace NS; fn NS.Foo() {} // --- fail_conflict.carbon -package Example library "fn_then_namespace"; +package Example library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. // CHECK:STDERR: import library "fn"; diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index b57c82ce88e7..361f120ceee5 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -10,34 +10,34 @@ // --- a.carbon -package Same library "a"; +package Same library "[[@TEST_NAME]]"; namespace A; // --- b.carbon -package Same library "b"; +package Same library "[[@TEST_NAME]]"; import library "a"; namespace A.B; // --- c.carbon -package Same library "c"; +package Same library "[[@TEST_NAME]]"; import library "b"; namespace A.B.C; // --- d.carbon -package Same library "d"; +package Same library "[[@TEST_NAME]]"; import library "c"; fn A.B.C.D() {}; // --- e.carbon -package Same library "e"; +package Same library "[[@TEST_NAME]]"; import library "d"; var e: () = A.B.C.D(); diff --git a/toolchain/check/testdata/namespace/merging.carbon b/toolchain/check/testdata/namespace/merging.carbon index 5a8a2bdfddd3..cad41928f233 100644 --- a/toolchain/check/testdata/namespace/merging.carbon +++ b/toolchain/check/testdata/namespace/merging.carbon @@ -10,7 +10,7 @@ // --- a.carbon -package Example library "a"; +package Example library "[[@TEST_NAME]]"; namespace NS; @@ -18,7 +18,7 @@ fn NS.A() {} // --- b.carbon -package Example library "b"; +package Example library "[[@TEST_NAME]]"; namespace NS; @@ -30,7 +30,7 @@ fn NS.B2() {} // --- c.carbon -package Example library "c"; +package Example library "[[@TEST_NAME]]"; import library "a"; import library "b"; diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index 18aa50cc4d85..a3b9394394f9 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -10,14 +10,14 @@ // --- a.carbon -package Other library "a"; +package Other library "[[@TEST_NAME]]"; namespace NS1; class NS1.A {} // --- b.carbon -package Other library "b"; +package Other library "[[@TEST_NAME]]"; import library "a"; namespace NS1; diff --git a/toolchain/check/testdata/packages/explicit_imports.carbon b/toolchain/check/testdata/packages/explicit_imports.carbon index ca4cc0b269c9..f40df9067239 100644 --- a/toolchain/check/testdata/packages/explicit_imports.carbon +++ b/toolchain/check/testdata/packages/explicit_imports.carbon @@ -14,29 +14,29 @@ package Api; // --- api_lib.carbon -package Api library "lib"; +package Api library "[[@TEST_NAME]]"; // --- same_package.carbon -package Api library "other"; +package Api library "[[@TEST_NAME]]"; import library default; -import library "lib"; +import library "api_lib"; // --- different_package.carbon package ApiOther; import Api; -import Api library "lib"; +import Api library "api_lib"; // --- main_lib_api.carbon -library "lib"; +library "[[@TEST_NAME]]"; // --- main_import.carbon -import library "lib"; +import library "main_lib_api"; // CHECK:STDOUT: --- api.carbon // CHECK:STDOUT: @@ -120,7 +120,7 @@ import library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: %Api: = namespace file.%Api.import, [template] { // CHECK:STDOUT: import Api//default -// CHECK:STDOUT: import Api//lib +// CHECK:STDOUT: import Api//api_lib // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_api_not_found.carbon b/toolchain/check/testdata/packages/fail_api_not_found.carbon index 55055c9ae985..b719211ccabf 100644 --- a/toolchain/check/testdata/packages/fail_api_not_found.carbon +++ b/toolchain/check/testdata/packages/fail_api_not_found.carbon @@ -18,18 +18,18 @@ impl package Foo; // --- fail_no_api_lib.impl.carbon -// CHECK:STDERR: fail_no_api_lib.impl.carbon:[[@LINE+4]]:6: ERROR: Corresponding API for 'Foo//Bar' not found. -// CHECK:STDERR: impl package Foo library "Bar"; +// CHECK:STDERR: fail_no_api_lib.impl.carbon:[[@LINE+4]]:6: ERROR: Corresponding API for 'Foo//no_api_lib' not found. +// CHECK:STDERR: impl package Foo library "no_api_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -impl package Foo library "Bar"; +impl package Foo library "[[@TEST_NAME]]"; // --- fail_no_api_main_lib.impl.carbon -// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: ERROR: Corresponding API for 'Main//Bar' not found. -// CHECK:STDERR: impl library "Bar"; +// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: ERROR: Corresponding API for 'Main//no_api_main_lib' not found. +// CHECK:STDERR: impl library "no_api_main_lib"; // CHECK:STDERR: ^~~~~~~ -impl library "Bar"; +impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: --- fail_no_api.impl.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index 39ae92d4c474..ec337f779ccc 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -10,19 +10,19 @@ // --- fn.carbon -package Example library "fn"; +package Example library "[[@TEST_NAME]]"; fn Foo(); // --- var.carbon -package Example library "var"; +package Example library "[[@TEST_NAME]]"; var Foo: i32; // --- fail_conflict.carbon -package Example library "conflict"; +package Example library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. // CHECK:STDERR: import library "fn"; diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index 9dbb235c4c3f..352640cf5af5 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -22,18 +22,18 @@ // --- fail_main_lib.incorrect // CHECK:STDERR: fail_main_lib.incorrect:[[@LINE+4]]:1: ERROR: File extension of `.carbon` required for `api`. -// CHECK:STDERR: library "lib"; +// CHECK:STDERR: library "main_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -library "lib"; +library "[[@TEST_NAME]]"; -// --- fail_main_lib_impl.incorrect +// --- fail_main_lib.impl.incorrect -// CHECK:STDERR: fail_main_lib_impl.incorrect:[[@LINE+4]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. -// CHECK:STDERR: impl library "lib"; +// CHECK:STDERR: fail_main_lib.impl.incorrect:[[@LINE+4]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. +// CHECK:STDERR: impl library "main_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -impl library "lib"; +impl library "[[@TEST_NAME]]"; // --- fail_package.incorrect @@ -54,18 +54,18 @@ impl package Package; // --- fail_package_lib.incorrect // CHECK:STDERR: fail_package_lib.incorrect:[[@LINE+4]]:1: ERROR: File extension of `.carbon` required for `api`. -// CHECK:STDERR: package Package library "lib"; +// CHECK:STDERR: package Package library "package_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -package Package library "lib"; +package Package library "[[@TEST_NAME]]"; -// --- fail_package_lib_impl.incorrect +// --- fail_package_lib.impl.incorrect -// CHECK:STDERR: fail_package_lib_impl.incorrect:[[@LINE+4]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. -// CHECK:STDERR: impl package Package library "lib"; +// CHECK:STDERR: fail_package_lib.impl.incorrect:[[@LINE+4]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. +// CHECK:STDERR: impl package Package library "package_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -impl package Package library "lib"; +impl package Package library "[[@TEST_NAME]]"; // --- fail_swapped_ext.impl.carbon @@ -150,7 +150,7 @@ impl package SwappedExt; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_main_lib_impl.incorrect +// CHECK:STDOUT: --- fail_main_lib.impl.incorrect // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { @@ -242,7 +242,7 @@ impl package SwappedExt; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_package_lib_impl.incorrect +// CHECK:STDOUT: --- fail_package_lib.impl.incorrect // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { diff --git a/toolchain/check/testdata/packages/fail_import_default.carbon b/toolchain/check/testdata/packages/fail_import_default.carbon index fd4d3c9c3c9c..1fcbc82fb023 100644 --- a/toolchain/check/testdata/packages/fail_import_default.carbon +++ b/toolchain/check/testdata/packages/fail_import_default.carbon @@ -38,7 +38,7 @@ import library default; // --- fail_main_lib_import_default.carbon -library "lib"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_main_lib_import_default.carbon:[[@LINE+3]]:1: ERROR: Cannot import `Main//default`. // CHECK:STDERR: import library default; diff --git a/toolchain/check/testdata/packages/fail_import_invalid.carbon b/toolchain/check/testdata/packages/fail_import_invalid.carbon index ab315956ad7b..181ad0ef756b 100644 --- a/toolchain/check/testdata/packages/fail_import_invalid.carbon +++ b/toolchain/check/testdata/packages/fail_import_invalid.carbon @@ -50,15 +50,15 @@ import This; // --- fail_this_lib.carbon -package This library "lib"; +package This library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_this_lib.carbon:[[@LINE+4]]:1: ERROR: File cannot import itself. -// CHECK:STDERR: import library "lib"; +// CHECK:STDERR: import library "this_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -import library "lib"; +import library "this_lib"; -// --- implicit_api.carbon +// --- implicit.carbon package Implicit; @@ -72,19 +72,19 @@ impl package Implicit; // CHECK:STDERR: import Implicit; -// --- implicit_lib_api.carbon +// --- implicit_lib.carbon -package Implicit library "lib"; +package Implicit library "[[@TEST_NAME]]"; // --- fail_implicit_lib.impl.carbon -impl package Implicit library "lib"; +impl package Implicit library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_implicit_lib.impl.carbon:[[@LINE+4]]:1: ERROR: Explicit import of `api` from `impl` file is redundant with implicit import. -// CHECK:STDERR: import Implicit library "lib"; +// CHECK:STDERR: import Implicit library "implicit_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -import Implicit library "lib"; +import Implicit library "implicit_lib"; // --- fail_not_found.carbon package NotFound; @@ -182,7 +182,7 @@ import ImportNotFound; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- implicit_api.carbon +// CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { @@ -228,7 +228,7 @@ import ImportNotFound; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- implicit_lib_api.carbon +// CHECK:STDOUT: --- implicit_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { diff --git a/toolchain/check/testdata/packages/fail_import_repeat.carbon b/toolchain/check/testdata/packages/fail_import_repeat.carbon index 8a80f032ebe9..eaa540a46d49 100644 --- a/toolchain/check/testdata/packages/fail_import_repeat.carbon +++ b/toolchain/check/testdata/packages/fail_import_repeat.carbon @@ -14,11 +14,11 @@ package Api; // --- api_lib.carbon -package Api library "lib"; +package Api library "[[@TEST_NAME]]"; // --- main_lib.carbon -library "lib"; +library "[[@TEST_NAME]]"; // --- fail_import.carbon @@ -32,29 +32,29 @@ import Api; // CHECK:STDERR: import Api; -import Api library "lib"; +import Api library "api_lib"; // CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: ERROR: Library imported more than once. -// CHECK:STDERR: import Api library "lib"; +// CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: First import here. -// CHECK:STDERR: import Api library "lib"; +// CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -import Api library "lib"; +import Api library "api_lib"; -import library "lib"; +import library "main_lib"; // CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: ERROR: Library imported more than once. -// CHECK:STDERR: import library "lib"; +// CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: First import here. -// CHECK:STDERR: import library "lib"; +// CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -import library "lib"; +import library "main_lib"; // --- fail_default_import.carbon -package Api library "not_default"; +package Api library "[[@TEST_NAME]]"; import library default; // CHECK:STDERR: fail_default_import.carbon:[[@LINE+6]]:1: ERROR: Library imported more than once. @@ -146,7 +146,7 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: %Api: = namespace file.%Api.import, [template] { // CHECK:STDOUT: import Api//default -// CHECK:STDOUT: import Api//lib +// CHECK:STDOUT: import Api//api_lib // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_package_main.carbon b/toolchain/check/testdata/packages/fail_package_main.carbon index 36bdcfd049ff..21bc1a37b149 100644 --- a/toolchain/check/testdata/packages/fail_package_main.carbon +++ b/toolchain/check/testdata/packages/fail_package_main.carbon @@ -36,9 +36,9 @@ package r#Main; // --- fail_main_lib.carbon // CHECK:STDERR: fail_main_lib.carbon:[[@LINE+3]]:1: ERROR: Use `library` declaration in `Main` package libraries. -// CHECK:STDERR: package Main library "lib"; +// CHECK:STDERR: package Main library "main_lib"; // CHECK:STDERR: ^~~~~~~ -package Main library "lib"; +package Main library "[[@TEST_NAME]]"; // CHECK:STDOUT: --- fail_main.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 413778ed1b0b..f9f6cb3298d0 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -12,13 +12,13 @@ // --- lib.carbon -library "lib"; +library "[[@TEST_NAME]]"; var a: i32 = 0; // --- lib.impl.carbon -impl library "lib"; +impl library "[[@TEST_NAME]]"; var b: i32 = a; diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index 631d02ad3bff..eb4e8a16afe6 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -30,7 +30,7 @@ fn B(); // --- same_package_importer.carbon -package SamePackage library "importer"; +package SamePackage library "[[@TEST_NAME]]"; import library default; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index e0fc96b2d33c..6201e9203806 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -14,7 +14,7 @@ // --- base.carbon -package Other library "base"; +package Other library "[[@TEST_NAME]]"; class C { var x: (); @@ -22,31 +22,31 @@ class C { // --- conflict.carbon -package Other library "conflict"; +package Other library "[[@TEST_NAME]]"; fn C() {} // --- export_import.carbon -package Other library "export_import"; +package Other library "[[@TEST_NAME]]"; export import library "base"; // --- export_import_copy.carbon -package Other library "export_import_copy"; +package Other library "[[@TEST_NAME]]"; export import library "base"; // --- export_import_indirect.carbon -package Other library "export_import_indirect"; +package Other library "[[@TEST_NAME]]"; export import library "export_import"; // --- export_name.carbon -package Other library "export_name"; +package Other library "[[@TEST_NAME]]"; import library "base"; @@ -54,7 +54,7 @@ export C; // --- export_name_copy.carbon -package Other library "export_name_copy"; +package Other library "[[@TEST_NAME]]"; import library "base"; @@ -62,7 +62,7 @@ export C; // --- export_name_indirect.carbon -package Other library "export_name_indirect"; +package Other library "[[@TEST_NAME]]"; import library "export_name"; @@ -74,7 +74,7 @@ export C; // --- use_export_import.carbon -library "use_export_import"; +library "[[@TEST_NAME]]"; import Other library "export_import"; @@ -82,7 +82,7 @@ var c: Other.C = {.x = ()}; // --- use_export_import_with_copy.carbon -library "use_export_import_with_copy"; +library "[[@TEST_NAME]]"; import Other library "export_import"; import Other library "export_import_copy"; @@ -91,7 +91,7 @@ var c: Other.C = {.x = ()}; // --- use_export_import_indirect.carbon -library "use_export_import_indirect"; +library "[[@TEST_NAME]]"; import Other library "export_import_indirect"; @@ -99,7 +99,7 @@ var c: Other.C = {.x = ()}; // --- use_export_name.carbon -library "use_export_name"; +library "[[@TEST_NAME]]"; import Other library "export_name"; @@ -107,7 +107,7 @@ var c: Other.C = {.x = ()}; // --- use_export_name_with_copy.carbon -library "use_export_name_with_copy"; +library "[[@TEST_NAME]]"; import Other library "export_name"; import Other library "export_name_copy"; @@ -116,7 +116,7 @@ var c: Other.C = {.x = ()}; // --- use_export_name_indirect.carbon -library "use_export_name_indirect"; +library "[[@TEST_NAME]]"; import Other library "export_name_indirect"; @@ -124,7 +124,7 @@ var c: Other.C = {.x = ()}; // --- use_export_all.carbon -library "use_export_all"; +library "[[@TEST_NAME]]"; import Other library "export_import"; import Other library "export_name"; @@ -137,21 +137,21 @@ var c: Other.C = {.x = ()}; // --- unused_conflict_on_export_import.carbon -library "unused_conflict_on_export_import"; +library "[[@TEST_NAME]]"; import Other library "export_import"; import Other library "conflict"; // --- unused_conflict_on_export_name.carbon -library "unused_conflict_on_export_name"; +library "[[@TEST_NAME]]"; import Other library "export_name"; import Other library "conflict"; // --- fail_conflict_on_export_import.carbon -library "fail_conflict_on_export_import"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+12]]:1: In import. // CHECK:STDERR: import Other library "export_import"; @@ -176,7 +176,7 @@ alias C = Other.C; // --- fail_conflict_on_export_name.carbon -library "fail_conflict_on_export_name"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+15]]:1: In import. // CHECK:STDERR: import Other library "export_name"; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index bc661e3ec554..b3f9c8179016 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -14,39 +14,39 @@ // --- other_fn.carbon -package Other library "fn"; +package Other library "[[@TEST_NAME]]"; fn F() {} // --- other_fn_extern.carbon -package Other library "fn_extern"; +package Other library "[[@TEST_NAME]]"; extern fn F(); // --- other_fn_conflict.carbon -package Other library "fn_conflict"; +package Other library "[[@TEST_NAME]]"; fn F(x: ()) {} // --- other_fn2.carbon -package Other library "fn2"; +package Other library "[[@TEST_NAME]]"; fn F2() {} // --- other_fn_use.carbon -package Other library "fn_use"; +package Other library "[[@TEST_NAME]]"; -import library "fn"; +import library "other_fn"; fn G() { F(); } // --- main_other_ns.carbon -library "other_ns"; +library "[[@TEST_NAME]]"; namespace Other; @@ -56,10 +56,10 @@ namespace Other; // --- main_use_other.carbon -library "use_other"; +library "[[@TEST_NAME]]"; -import Other library "fn"; -import Other library "fn2"; +import Other library "other_fn"; +import Other library "other_fn2"; fn Run() { Other.F(); @@ -68,22 +68,22 @@ fn Run() { // --- fail_todo_main_use_other_extern.carbon -library "use_other_extern"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+12]]:1: In import. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_fn_extern.carbon:4:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+6]]:1: In import. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_fn.carbon:4:1: Name is previously declared here. // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -import Other library "fn"; -import Other library "fn_extern"; +import Other library "other_fn"; +import Other library "other_fn_extern"; fn Run() { // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:3: In name lookup for `F`. @@ -95,29 +95,29 @@ fn Run() { // --- main_unused_other_ambiguous.carbon -library "unused_other_ambiguous"; +library "[[@TEST_NAME]]"; -import Other library "fn"; -import Other library "fn_conflict"; +import Other library "other_fn"; +import Other library "other_fn_conflict"; // --- fail_main_use_other_ambiguous.carbon -library "use_other_ambiguous"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+12]]:1: In import. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_fn_conflict.carbon:4:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: fn F(x: ()) {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+6]]:1: In import. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_fn.carbon:4:1: Name is previously declared here. // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -import Other library "fn"; -import Other library "fn_conflict"; +import Other library "other_fn"; +import Other library "other_fn_conflict"; fn Run() { // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:3: In name lookup for `F`. @@ -129,26 +129,26 @@ fn Run() { // --- fail_main_namespace_conflict.carbon -library "namespace_conflict"; +library "[[@TEST_NAME]]"; -import library "other_ns"; +import library "main_other_ns"; // CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-4]]:1: In import. -// CHECK:STDERR: import library "other_ns"; +// CHECK:STDERR: import library "main_other_ns"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: main_other_ns.carbon:4:1: Name is previously declared here. // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: -import Other library "fn"; +import Other library "other_fn"; // CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `fn F` is redundant. // CHECK:STDERR: fn Other.F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-5]]:1: In import. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: other_fn.carbon:4:1: Previously declared here. // CHECK:STDERR: fn F() {} @@ -158,15 +158,15 @@ fn Other.F() {} // --- fail_main_reopen_other.carbon -library "reopen_other"; +library "[[@TEST_NAME]]"; -import Other library "fn"; +import Other library "other_fn"; // CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE+7]]:1: ERROR: Duplicate name being declared in the same scope. // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE-5]]:1: Name is previously declared here. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: namespace Other; @@ -176,15 +176,15 @@ fn Other.G() {} // --- fail_main_reopen_other_nested.carbon -library "reopen_other_nested"; +library "[[@TEST_NAME]]"; -import Other library "fn"; +import Other library "other_fn"; // CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE+7]]:11: ERROR: Imported packages cannot be used for declarations. // CHECK:STDERR: namespace Other.Nested; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE-5]]:1: Package imported here. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: namespace Other.Nested; @@ -194,24 +194,24 @@ fn Other.Nested.F() {} // --- fail_main_add_to_other.carbon -library "add_to_other"; +library "[[@TEST_NAME]]"; -import Other library "fn"; +import Other library "other_fn"; // CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE+7]]:4: ERROR: Imported packages cannot be used for declarations. // CHECK:STDERR: fn Other.G() {} // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE-5]]:1: Package imported here. -// CHECK:STDERR: import Other library "fn"; +// CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fn Other.G() {} // --- fail_use_other_fn_use.carbon -library "fail_use_other_fn_use"; +library "[[@TEST_NAME]]"; -import Other library "fn_use"; +import Other library "other_fn_use"; // CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: ERROR: Name `F` not found. // CHECK:STDERR: fn UseF() { Other.F(); } @@ -311,7 +311,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -357,11 +357,11 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .F = %import_ref.1 // CHECK:STDOUT: .F2 = %import_ref.2 -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: import Other//fn2 +// CHECK:STDOUT: import Other//other_fn +// CHECK:STDOUT: import Other//other_fn2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2: %F2.type = import_ref Other//fn2, inst+1, loaded [template = constants.%F2] +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: %F2.type = import_ref Other//other_fn2, inst+1, loaded [template = constants.%F2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -401,11 +401,11 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .F = %import_ref.1 -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: import Other//fn_extern +// CHECK:STDOUT: import Other//other_fn +// CHECK:STDOUT: import Other//other_fn_extern // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//fn_extern, inst+1, unloaded +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_fn_extern, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -431,8 +431,8 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: import Other//fn_conflict +// CHECK:STDOUT: import Other//other_fn +// CHECK:STDOUT: import Other//other_fn_conflict // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -456,11 +456,11 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .F = %import_ref.1 -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: import Other//fn_conflict +// CHECK:STDOUT: import Other//other_fn +// CHECK:STDOUT: import Other//other_fn_conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//fn_conflict, inst+6, unloaded +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_fn_conflict, inst+6, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -491,12 +491,12 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: = import_ref Main//other_ns, inst+1, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref Main//main_other_ns, inst+1, loaded // CHECK:STDOUT: %Other: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .F = file.%F.decl -// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: %F.type = import_ref Other//other_fn, inst+1, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -524,7 +524,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .G = file.%G.decl -// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -535,7 +535,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace [template] { // CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: } @@ -556,7 +556,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .Nested = file.%Nested -// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -587,7 +587,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .G = file.%G.decl -// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//other_fn // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -614,7 +614,7 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { -// CHECK:STDOUT: import Other//fn_use +// CHECK:STDOUT: import Other//other_fn_use // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index 9ad8b47063fd..44c012035a46 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -14,7 +14,7 @@ // --- base.carbon -library "base"; +library "[[@TEST_NAME]]"; class C { var x: (); @@ -22,31 +22,31 @@ class C { // --- export.carbon -library "export"; +library "[[@TEST_NAME]]"; export import library "base"; // --- export_copy.carbon -library "export_copy"; +library "[[@TEST_NAME]]"; export import library "base"; // --- non_export.carbon -library "non_export"; +library "[[@TEST_NAME]]"; import library "export"; // --- export_export.carbon -library "export_export"; +library "[[@TEST_NAME]]"; export import library "export"; // --- import_then_export.carbon -library "import_then_export"; +library "[[@TEST_NAME]]"; import library "base"; export import library "export"; @@ -54,7 +54,7 @@ export import library "export"; // --- export_in_impl.carbon // This is just providing an API for the implicit import. -library "export_in_impl"; +library "[[@TEST_NAME]]"; // ============================================================================ // Test files @@ -62,7 +62,7 @@ library "export_in_impl"; // --- use_export.carbon -library "use_export"; +library "[[@TEST_NAME]]"; import library "export"; @@ -70,7 +70,7 @@ var c: C = {.x = ()}; // --- fail_export_in_impl.impl.carbon -impl library "export_in_impl"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+4]]:1: ERROR: `export` is only allowed in API files. // CHECK:STDERR: export import library "base"; @@ -83,13 +83,13 @@ var c: C = {.x = ()}; // --- export_export.impl.carbon -impl library "export_export"; +impl library "[[@TEST_NAME]]"; var c: C = {.x = ()}; // --- use_export_export.carbon -library "use_export_export"; +library "[[@TEST_NAME]]"; import library "export_export"; @@ -97,7 +97,7 @@ var c: C = {.x = ()}; // --- use_import_then_export.carbon -library "use_import_then_export"; +library "[[@TEST_NAME]]"; import library "import_then_export"; @@ -105,7 +105,7 @@ var c: C = {.x = ()}; // --- use_import_when_export.carbon -library "use_import_when_export"; +library "[[@TEST_NAME]]"; export import library "base"; @@ -113,7 +113,7 @@ var c: C = {.x = ()}; // --- use_base_and_export.carbon -library "use_base_and_export"; +library "[[@TEST_NAME]]"; import library "base"; import library "export"; @@ -122,7 +122,7 @@ var c: C = {.x = ()}; // --- use_export_and_base.carbon -library "import_both_reversed"; +library "[[@TEST_NAME]]"; import library "export"; import library "base"; @@ -131,7 +131,7 @@ var c: C = {.x = ()}; // --- use_export_copy.carbon -library "use_export_copy"; +library "[[@TEST_NAME]]"; import library "export"; import library "export_copy"; @@ -140,7 +140,7 @@ var c: C = {.x = ()}; // --- fail_use_non_export.carbon -library "fail_use_non_export"; +library "[[@TEST_NAME]]"; import library "non_export"; @@ -151,7 +151,7 @@ alias Local = C; // --- use_non_export_then_base.carbon -library "use_non_export_then_base"; +library "[[@TEST_NAME]]"; import library "non_export"; export import library "base"; @@ -160,7 +160,7 @@ var c: C = {.x = ()}; // --- indirect_use_non_export_then_base.carbon -library "indirect_use_non_export_then_base"; +library "[[@TEST_NAME]]"; import library "use_non_export_then_base"; diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index f052315533c2..4e7d4feb49b8 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -14,7 +14,7 @@ // --- base.carbon -library "base"; +library "[[@TEST_NAME]]"; class C { var x: (); @@ -26,13 +26,13 @@ class D { // --- export_import.carbon -library "export_import"; +library "[[@TEST_NAME]]"; export import library "base"; // --- export_import_then_name.carbon -library "export_import_then_name"; +library "[[@TEST_NAME]]"; import library "export_import"; @@ -40,7 +40,7 @@ export C; // --- export_name.carbon -library "export_name"; +library "[[@TEST_NAME]]"; import library "base"; @@ -48,7 +48,7 @@ export C; // --- export_name_then_import.carbon -library "export_name_then_import"; +library "[[@TEST_NAME]]"; export import library "export_name"; @@ -58,7 +58,7 @@ export import library "export_name"; // --- use_export_import_then_name.carbon -library "use_export_import_then_name"; +library "[[@TEST_NAME]]"; import library "export_import_then_name"; @@ -66,7 +66,7 @@ var c: C = {.x = ()}; // --- use_export_name_then_import.carbon -library "use_export_name_then_import"; +library "[[@TEST_NAME]]"; import library "export_name_then_import"; @@ -74,7 +74,7 @@ var c: C = {.x = ()}; // --- use_both.carbon -library "use_both"; +library "[[@TEST_NAME]]"; import library "export_import_then_name"; import library "export_name_then_import"; @@ -83,7 +83,7 @@ var c: C = {.x = ()}; // --- fail_nonexport_use_both.carbon -library "fail_nonexport_use_both"; +library "[[@TEST_NAME]]"; import library "export_import_then_name"; import library "export_name_then_import"; @@ -95,7 +95,7 @@ var d: D = {.y = ()}; // --- use_both_reversed.carbon -library "use_both_reversed"; +library "[[@TEST_NAME]]"; import library "export_import_then_name"; import library "export_name_then_import"; @@ -104,7 +104,7 @@ var c: C = {.x = ()}; // --- use_both_and_export_import.carbon -library "use_both_and_export_import"; +library "[[@TEST_NAME]]"; import library "export_import_then_name"; import library "export_name_then_import"; diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index 4f22ec8f926c..51d840f6e94a 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -14,7 +14,7 @@ // --- base.carbon -library "base"; +library "[[@TEST_NAME]]"; class C { var x: (); @@ -27,7 +27,7 @@ class NS.NSC { // --- export.carbon -library "export"; +library "[[@TEST_NAME]]"; import library "base"; export C; @@ -35,13 +35,13 @@ export NS.NSC; // --- not_reexporting.carbon -library "not_reexporting"; +library "[[@TEST_NAME]]"; import library "export"; // --- export_export.carbon -library "export_export"; +library "[[@TEST_NAME]]"; import library "export"; export C; @@ -50,7 +50,7 @@ export NS.NSC; // --- export_in_impl.carbon // This is just providing an API for the implicit import. -library "export_in_impl"; +library "[[@TEST_NAME]]"; // ============================================================================ // Test files @@ -58,7 +58,7 @@ library "export_in_impl"; // --- use_export.carbon -library "use_export"; +library "[[@TEST_NAME]]"; import library "export"; @@ -67,14 +67,14 @@ var nsc: NS.NSC = {.y = ()}; // --- export_export.impl.carbon -impl library "export_export"; +impl library "[[@TEST_NAME]]"; var c: C = {.x = ()}; var nsc: NS.NSC = {.y = ()}; // --- use_export_export.carbon -library "use_export_export"; +library "[[@TEST_NAME]]"; import library "export_export"; @@ -83,7 +83,7 @@ var nsc: NS.NSC = {.y = ()}; // --- fail_export_ns.carbon -library "fail_export_ns"; +library "[[@TEST_NAME]]"; import library "base"; @@ -101,7 +101,7 @@ export NS; // --- fail_export_decl.carbon -library "fail_export_decl"; +library "[[@TEST_NAME]]"; class Local {} @@ -116,7 +116,7 @@ export Local; // --- fail_export_member.carbon -library "fail_export_member"; +library "[[@TEST_NAME]]"; import library "base"; @@ -134,7 +134,7 @@ export C.x; // --- import_both.carbon -library "import_both"; +library "[[@TEST_NAME]]"; import library "base"; import library "export"; @@ -144,7 +144,7 @@ var nsc: NS.NSC = {.y = ()}; // --- import_both_reversed.carbon -library "import_both_reversed"; +library "[[@TEST_NAME]]"; import library "export"; import library "base"; @@ -154,7 +154,7 @@ var nsc: NS.NSC = {.y = ()}; // --- fail_use_not_reexporting.carbon -library "fail_use_not_reexporting"; +library "[[@TEST_NAME]]"; import library "not_reexporting"; @@ -171,7 +171,7 @@ alias NSLocal = NS.NSC; // --- repeat_export.carbon -library "repeat_export"; +library "[[@TEST_NAME]]"; import library "base"; @@ -187,7 +187,7 @@ export C; // --- use_repeat_export.carbon -library "use_repeat_export"; +library "[[@TEST_NAME]]"; import library "repeat_export"; @@ -195,7 +195,7 @@ var c: C = {.x = ()}; // --- fail_modifiers.carbon -library "fail_modifiers"; +library "[[@TEST_NAME]]"; import library "base"; diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index 27697b8a4a06..c69fa18e9c53 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -10,7 +10,7 @@ // --- a.carbon -package Foo library "a"; +package Foo library "[[@TEST_NAME]]"; class C { var n: {}; @@ -18,7 +18,7 @@ class C { // --- fail_b.carbon -package Foo library "b"; +package Foo library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index 6e62138da2dd..33a61f283a1a 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -10,14 +10,14 @@ // --- a.carbon -package Foo library "a"; +package Foo library "[[@TEST_NAME]]"; class C1(T:! type); class C2(T:! type); // --- fail_b.carbon -package Foo library "b"; +package Foo library "[[@TEST_NAME]]"; import library "a"; diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon index 51eaa94234bb..d0921a208b6e 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon @@ -14,7 +14,7 @@ package ApiOnly; // --- api_only_lib.carbon -package ApiOnly library "lib"; +package ApiOnly library "[[@TEST_NAME]]"; // --- with_impl.carbon @@ -31,21 +31,21 @@ impl package WithImpl; // --- with_impl_lib.carbon -package WithImpl library "lib"; +package WithImpl library "[[@TEST_NAME]]"; // --- with_impl_lib.impl.carbon -impl package WithImpl library "lib"; +impl package WithImpl library "[[@TEST_NAME]]"; // --- main.carbon // --- main_lib.carbon -library "lib"; +library "[[@TEST_NAME]]"; // --- main_lib.impl.carbon -impl library "lib"; +impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: --- api_only.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index 209a9dfed53d..ea33319480ae 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -14,38 +14,38 @@ // --- c1.carbon -library "C1"; +library "[[@TEST_NAME]]"; class C1 {} // --- c2.carbon -library "C2"; +library "[[@TEST_NAME]]"; class C2 {} // --- ns.carbon -library "ns"; +library "[[@TEST_NAME]]"; namespace NS; class NS.C {} // --- o1.carbon -package Other library "O1"; +package Other library "[[@TEST_NAME]]"; class O1 {} // --- o2.carbon -package Other library "O2"; +package Other library "[[@TEST_NAME]]"; class O2 {} // --- local_other.carbon -library "local_other"; +library "[[@TEST_NAME]]"; class Other {} @@ -55,79 +55,79 @@ class Other {} // --- mix_current_package.carbon -library "mix_current_package"; +library "[[@TEST_NAME]]"; -import library "C1"; +import library "c1"; // --- mix_current_package.impl.carbon -impl library "mix_current_package"; +impl library "[[@TEST_NAME]]"; -import library "C2"; +import library "c2"; var c1: C1 = {}; var c2: C2 = {}; // --- dup_c1.carbon -library "dup_c1"; +library "[[@TEST_NAME]]"; -import library "C1"; +import library "c1"; // --- dup_c1.impl.carbon -impl library "dup_c1"; +impl library "[[@TEST_NAME]]"; -import library "C1"; +import library "c1"; var c1: C1 = {}; // --- use_ns.carbon -library "use_ns"; +library "[[@TEST_NAME]]"; import library "ns"; // --- use_ns.impl.carbon -impl library "use_ns"; +impl library "[[@TEST_NAME]]"; var c: NS.C = {}; // --- mix_other.carbon -library "mix_other"; +library "[[@TEST_NAME]]"; -import Other library "O1"; +import Other library "o1"; // --- mix_other.impl.carbon -impl library "mix_other"; +impl library "[[@TEST_NAME]]"; -import Other library "O2"; +import Other library "o2"; var o1: Other.O1 = {}; var o2: Other.O2 = {}; // --- dup_o1.carbon -library "dup_o1"; +library "[[@TEST_NAME]]"; -import Other library "O1"; +import Other library "o1"; // --- dup_o1.impl.carbon -impl library "dup_o1"; +impl library "[[@TEST_NAME]]"; -import Other library "O1"; +import Other library "o1"; var o1: Other.O1 = {}; // --- import_conflict.carbon -library "import_conflict"; +library "[[@TEST_NAME]]"; -import Other library "O1"; +import Other library "o1"; // --- fail_import_conflict.impl.carbon @@ -135,7 +135,7 @@ import Other library "O1"; // CHECK:STDERR: impl library "import_conflict"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: import_conflict.carbon:4:1: ERROR: Duplicate name being declared in the same scope. -// CHECK:STDERR: import Other library "O1"; +// CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+7]]:6: In import. // CHECK:STDERR: impl library "import_conflict"; @@ -144,22 +144,22 @@ import Other library "O1"; // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: -impl library "import_conflict"; +impl library "[[@TEST_NAME]]"; import library "local_other"; // --- import_conflict_reverse.carbon -library "import_conflict_reverse"; +library "[[@TEST_NAME]]"; import library "local_other"; // --- fail_import_conflict_reverse.impl.carbon -impl library "import_conflict_reverse"; +impl library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+12]]:1: ERROR: Duplicate name being declared in the same scope. -// CHECK:STDERR: import Other library "O1"; +// CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE-5]]:6: In import. // CHECK:STDERR: impl library "import_conflict_reverse"; @@ -170,7 +170,7 @@ impl library "import_conflict_reverse"; // CHECK:STDERR: local_other.carbon:4:1: Name is previously declared here. // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ -import Other library "O1"; +import Other library "o1"; // CHECK:STDOUT: --- c1.carbon // CHECK:STDOUT: @@ -292,7 +292,7 @@ import Other library "O1"; // CHECK:STDOUT: --- mix_current_package.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//C1, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//c1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -316,9 +316,9 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//mix_current_package, inst+2, loaded [template = constants.%C1] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//C2, inst+1, loaded [template = constants.%C2] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//C1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//C2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//c2, inst+1, loaded [template = constants.%C2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//c2, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -364,7 +364,7 @@ import Other library "O1"; // CHECK:STDOUT: --- dup_c1.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//C1, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//c1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -386,7 +386,7 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//dup_c1, inst+2, loaded [template = constants.%C1] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//C1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//c1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -482,7 +482,7 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { -// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -509,13 +509,13 @@ import Other library "O1"; // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .O1 = %import_ref.1 // CHECK:STDOUT: .O2 = %import_ref.3 -// CHECK:STDOUT: import Other//O2 -// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: import Other//o2 +// CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//O1, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//O1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Other//O2, inst+1, loaded [template = constants.%O2] -// CHECK:STDOUT: %import_ref.4 = import_ref Other//O2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, inst+1, loaded [template = constants.%O1] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//o1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Other//o2, inst+1, loaded [template = constants.%O2] +// CHECK:STDOUT: %import_ref.4 = import_ref Other//o2, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -564,7 +564,7 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { -// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -588,10 +588,10 @@ import Other library "O1"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .O1 = %import_ref.1 -// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//O1, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//O1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, inst+1, loaded [template = constants.%O1] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//o1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -626,7 +626,7 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { -// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -642,7 +642,7 @@ import Other library "O1"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref = import_ref Main//local_other, inst+1, unloaded // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { -// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -673,7 +673,7 @@ import Other library "O1"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref = import_ref Main//import_conflict_reverse, inst+2, unloaded // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { -// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index dab7df775649..489597035673 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -10,7 +10,7 @@ // --- fail_missing_prelude.carbon -library "fail_missing_prelude"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_missing_prelude.carbon:[[@LINE+4]]:8: ERROR: Package `Core` implicitly referenced here, but not found. // CHECK:STDERR: var n: i32; @@ -20,13 +20,13 @@ var n: i32; // --- prelude_empty.carbon -package Core library "empty"; +package Core library "[[@TEST_NAME]]"; // --- fail_missing_prelude_member.carbon -library "fail_missing_prelude_member"; +library "[[@TEST_NAME]]"; -import Core library "empty"; +import Core library "prelude_empty"; // CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: ERROR: Name `Core.Int32` implicitly referenced here, but not found. // CHECK:STDERR: var n: i32; @@ -36,21 +36,21 @@ var n: i32; // --- prelude_fake_int.carbon -package Core library "fake_int"; +package Core library "[[@TEST_NAME]]"; fn Int32() -> {} { return {}; } // --- use_fake_int.carbon -library "use_fake_int"; +library "[[@TEST_NAME]]"; -import Core library "fake_int"; +import Core library "prelude_fake_int"; var n: {} = i32; // --- prelude_use_in_prelude.carbon -package Core library "prelude_use_in_prelude"; +package Core library "[[@TEST_NAME]]"; // Core is not an imported package here. @@ -62,7 +62,7 @@ var n: () = i32; // --- prelude_as_namespace.carbon -library "prelude_as_namespace"; +library "[[@TEST_NAME]]"; // TODO: Decide whether we want to accept this. namespace Core; @@ -73,7 +73,7 @@ var n: {} = i32; // --- fail_prelude_as_class.carbon -library "prelude_as_class"; +library "[[@TEST_NAME]]"; // TODO: Decide whether we want to accept this. class Core { @@ -105,7 +105,7 @@ var n: {} = i32; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//empty +// CHECK:STDOUT: import Core//prelude_empty // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -160,9 +160,9 @@ var n: {} = i32; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref -// CHECK:STDOUT: import Core//fake_int +// CHECK:STDOUT: import Core//prelude_fake_int // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//fake_int, inst+5, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude_fake_int, inst+5, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index c11b292cfbfc..587499b9381b 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -14,13 +14,13 @@ // --- base.carbon -library "base"; +library "[[@TEST_NAME]]"; var v: (); // --- export.carbon -library "export"; +library "[[@TEST_NAME]]"; import library "base"; @@ -32,7 +32,7 @@ export v; // --- fail_todo_use_export.carbon -library "use_export"; +library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+9]]:1: In import. // CHECK:STDERR: import library "export"; diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index 714b3ab43027..15fd086e20da 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -14,7 +14,7 @@ // --- def.carbon -package Test library "def"; +package Test library "[[@TEST_NAME]]"; private var v: () = (); @@ -24,13 +24,13 @@ private var v: () = (); // --- def.impl.carbon -impl package Test library "def"; +impl package Test library "[[@TEST_NAME]]"; var v2: () = v; // --- fail_local_def.carbon -package Test library "fail_local_def"; +package Test library "[[@TEST_NAME]]"; import library "def"; @@ -42,7 +42,7 @@ var v2: () = v; // --- fail_other_def.carbon -package Other library "fail_other_def"; +package Other library "[[@TEST_NAME]]"; import Test library "def"; diff --git a/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon b/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon index 1e3bd174186f..e63f7939c33c 100644 --- a/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon +++ b/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon @@ -10,7 +10,7 @@ // --- fail_designator_matches_var.carbon -library "designator_matches_var"; +library "[[@TEST_NAME]]"; fn Foo() -> () { var x: (); @@ -23,7 +23,7 @@ fn Foo() -> () { // --- fail_unknown_designator.carbon -library "unknown_designator"; +library "[[@TEST_NAME]]"; fn Bar() -> () { // CHECK:STDERR: fail_unknown_designator.carbon:[[@LINE+4]]:10: ERROR: Semantics TODO: `HandleDesignatorExpr`. @@ -35,7 +35,7 @@ fn Bar() -> () { // --- fail_dot_self_method_return_value.carbon -library "dot_self_method_return_value"; +library "[[@TEST_NAME]]"; class C { // CHECK:STDERR: fail_dot_self_method_return_value.carbon:[[@LINE+4]]:28: ERROR: Semantics TODO: `HandleSelfTypeName`. @@ -47,7 +47,7 @@ class C { // --- fail_dot_self_method_return_type.carbon -library "dot_self_method_return_type"; +library "[[@TEST_NAME]]"; class D { // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+3]]:14: ERROR: Semantics TODO: `HandleSelfTypeName`. diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index b51a4a961d39..4e6f176cd77a 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -10,7 +10,7 @@ // --- adapt_class.carbon -library "adapt_class"; +library "[[@TEST_NAME]]"; class PairOfInts { var a: i32; @@ -41,7 +41,7 @@ fn Use() -> i32 { // --- adapt_int.carbon -library "adapt_int"; +library "[[@TEST_NAME]]"; class Int { adapt i32; diff --git a/toolchain/parse/testdata/packages/export.carbon b/toolchain/parse/testdata/packages/export.carbon index 3a40da51182a..ce0de9887547 100644 --- a/toolchain/parse/testdata/packages/export.carbon +++ b/toolchain/parse/testdata/packages/export.carbon @@ -10,7 +10,7 @@ // --- lib.carbon -library "lib"; +library "[[@TEST_NAME]]"; // --- name.carbon diff --git a/toolchain/parse/testdata/packages/import/ordering.carbon b/toolchain/parse/testdata/packages/import/ordering.carbon index 91a68cb06c66..fc8522ed3973 100644 --- a/toolchain/parse/testdata/packages/import/ordering.carbon +++ b/toolchain/parse/testdata/packages/import/ordering.carbon @@ -15,7 +15,7 @@ import B; // --- after_library.carbon -library "A"; +library "[[@TEST_NAME]]"; import B; @@ -40,7 +40,7 @@ import B; // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'LibraryIntroducer', text: 'library'}, -// CHECK:STDOUT: {kind: 'LibraryName', text: '"A"'}, +// CHECK:STDOUT: {kind: 'LibraryName', text: '"after_library"'}, // CHECK:STDOUT: {kind: 'LibraryDecl', text: ';', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'}, // CHECK:STDOUT: {kind: 'PackageName', text: 'B'}, diff --git a/toolchain/parse/testdata/packages/library/basic.carbon b/toolchain/parse/testdata/packages/library/basic.carbon index 320aeae471da..2f7d9d489762 100644 --- a/toolchain/parse/testdata/packages/library/basic.carbon +++ b/toolchain/parse/testdata/packages/library/basic.carbon @@ -14,7 +14,7 @@ library default; // --- named.carbon -impl library "Shapes"; +impl library "[[@TEST_NAME]]"; // CHECK:STDOUT: - filename: default.carbon // CHECK:STDOUT: parse_tree: [ @@ -29,7 +29,7 @@ impl library "Shapes"; // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'LibraryIntroducer', text: 'library'}, // CHECK:STDOUT: {kind: 'ImplModifier', text: 'impl'}, -// CHECK:STDOUT: {kind: 'LibraryName', text: '"Shapes"'}, +// CHECK:STDOUT: {kind: 'LibraryName', text: '"named"'}, // CHECK:STDOUT: {kind: 'LibraryDecl', text: ';', subtree_size: 4}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon index aae4c34afc1f..549d16f611ec 100644 --- a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon +++ b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon @@ -46,11 +46,11 @@ library; // CHECK:STDERR: library "trailing_impl" impl // CHECK:STDERR: ^~~~ // CHECK:STDERR: -library "trailing_impl" impl +library "[[@TEST_NAME]]" impl // --- fail_no_semi.carbon -library "NoSemi" +library "[[@TEST_NAME]]" // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+46]]:21: ERROR: `library` declarations must end with a `;`. // CHECK:STDERR: // CHECK:STDOUT: ] @@ -95,7 +95,7 @@ library "NoSemi" // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'LibraryIntroducer', text: 'library'}, -// CHECK:STDOUT: {kind: 'LibraryName', text: '"NoSemi"'}, -// CHECK:STDOUT: {kind: 'LibraryDecl', text: '"NoSemi"', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'LibraryName', text: '"no_semi"'}, +// CHECK:STDOUT: {kind: 'LibraryDecl', text: '"no_semi"', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon index 98b230076441..3a684f4c9a7c 100644 --- a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon @@ -11,12 +11,12 @@ ; // CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: ERROR: The `library` declaration must be the first non-comment line. -// CHECK:STDERR: library "foo"; +// CHECK:STDERR: library "semi_before"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: First non-comment line is here. // CHECK:STDERR: ; // CHECK:STDERR: ^ -library "foo"; +library "[[@TEST_NAME]]"; // CHECK:STDOUT: - filename: fail_semi_before.carbon // CHECK:STDOUT: parse_tree: [ diff --git a/toolchain/parse/testdata/packages/library/fail_too_late.carbon b/toolchain/parse/testdata/packages/library/fail_too_late.carbon index 16c913c388ef..641126afdcf8 100644 --- a/toolchain/parse/testdata/packages/library/fail_too_late.carbon +++ b/toolchain/parse/testdata/packages/library/fail_too_late.carbon @@ -11,12 +11,12 @@ import Geometry; // CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: ERROR: The `library` declaration must be the first non-comment line. -// CHECK:STDERR: library "Shapes"; +// CHECK:STDERR: library "too_late"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: First non-comment line is here. // CHECK:STDERR: import Geometry; // CHECK:STDERR: ^~~~~~ -library "Shapes"; +library "[[@TEST_NAME]]"; // CHECK:STDOUT: - filename: fail_too_late.carbon // CHECK:STDOUT: parse_tree: [ diff --git a/toolchain/parse/testdata/packages/package/api_library.carbon b/toolchain/parse/testdata/packages/package/api_library.carbon index f0192e21f6f7..c4bd9f1feb2f 100644 --- a/toolchain/parse/testdata/packages/package/api_library.carbon +++ b/toolchain/parse/testdata/packages/package/api_library.carbon @@ -8,14 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/api_library.carbon -package Geometry library "Shapes"; +package Geometry library "[[@TEST_NAME]]"; // CHECK:STDOUT: - filename: api_library.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'PackageIntroducer', text: 'package'}, // CHECK:STDOUT: {kind: 'PackageName', text: 'Geometry'}, -// CHECK:STDOUT: {kind: 'LibraryName', text: '"Shapes"'}, +// CHECK:STDOUT: {kind: 'LibraryName', text: '"api_library"'}, // CHECK:STDOUT: {kind: 'LibrarySpecifier', text: 'library', subtree_size: 2}, // CHECK:STDOUT: {kind: 'PackageDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, diff --git a/toolchain/parse/testdata/packages/package/impl_library.carbon b/toolchain/parse/testdata/packages/package/impl_library.carbon index 80ba4049491e..32a360b3f8e5 100644 --- a/toolchain/parse/testdata/packages/package/impl_library.carbon +++ b/toolchain/parse/testdata/packages/package/impl_library.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/impl_library.carbon -impl package Geometry library "Shapes"; +impl package Geometry library "[[@TEST_NAME]]"; // CHECK:STDOUT: - filename: impl_library.carbon // CHECK:STDOUT: parse_tree: [ @@ -16,7 +16,7 @@ impl package Geometry library "Shapes"; // CHECK:STDOUT: {kind: 'PackageIntroducer', text: 'package'}, // CHECK:STDOUT: {kind: 'ImplModifier', text: 'impl'}, // CHECK:STDOUT: {kind: 'PackageName', text: 'Geometry'}, -// CHECK:STDOUT: {kind: 'LibraryName', text: '"Shapes"'}, +// CHECK:STDOUT: {kind: 'LibraryName', text: '"impl_library"'}, // CHECK:STDOUT: {kind: 'LibrarySpecifier', text: 'library', subtree_size: 2}, // CHECK:STDOUT: {kind: 'PackageDecl', text: ';', subtree_size: 6}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''},