فهرست منبع

Split apart some tests which don't need the prelude. (#3904)

This could probably go further, but I'm just trying to get the ability
to run some significant tests without the prelude. This already requires
some migration of `i32` and `bool` to non-prelude-dependent types
(technically not at the moment, but I'm trying to stick with the
philosophical model of the prelude).

Note this undoes part of #3895 which had made all lex/parse tests depend
on the prelude -- I don't think that was a necessary change. Rather, it
seems better to isolate individual lex/parse tests from the prelude. I'd
been on the fence in that PR (it was fixing one of the issues that
contributed to wanting to not include the prelude), but now it feels
more consistent. The prelude could have a parse error and we shouldn't
break every parse test on that.
Jon Ross-Perkins 2 سال پیش
والد
کامیت
de4c32beb5
100فایلهای تغییر یافته به همراه1455 افزوده شده و 1106 حذف شده
  1. 0 46
      toolchain/check/testdata/alias/fail_aliased_name_in_diag.carbon
  2. 0 50
      toolchain/check/testdata/alias/fail_not_constant.carbon
  3. 0 80
      toolchain/check/testdata/alias/in_namespace.carbon
  4. 0 42
      toolchain/check/testdata/alias/local.carbon
  5. 13 22
      toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon
  6. 66 0
      toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon
  7. 12 11
      toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon
  8. 0 2
      toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon
  9. 21 16
      toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon
  10. 55 0
      toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon
  11. 0 2
      toolchain/check/testdata/alias/no_prelude/fail_todo_private.carbon
  12. 55 46
      toolchain/check/testdata/alias/no_prelude/import.carbon
  13. 51 50
      toolchain/check/testdata/alias/no_prelude/import_order.carbon
  14. 83 0
      toolchain/check/testdata/alias/no_prelude/in_namespace.carbon
  15. 48 0
      toolchain/check/testdata/alias/no_prelude/local.carbon
  16. 0 2
      toolchain/check/testdata/as/no_prelude/tuple.carbon
  17. 1 4
      toolchain/check/testdata/basics/no_prelude/empty.carbon
  18. 1 4
      toolchain/check/testdata/basics/no_prelude/empty_decl.carbon
  19. 0 2
      toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon
  20. 0 0
      toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon
  21. 0 0
      toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon
  22. 0 0
      toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon
  23. 0 0
      toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon
  24. 0 0
      toolchain/check/testdata/basics/no_prelude/raw_ir.carbon
  25. 0 0
      toolchain/check/testdata/basics/no_prelude/textual_ir.carbon
  26. 0 0
      toolchain/check/testdata/basics/no_prelude/verbose.carbon
  27. 17 12
      toolchain/check/testdata/function/call/no_prelude/alias.carbon
  28. 0 2
      toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon
  29. 0 2
      toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon
  30. 0 2
      toolchain/check/testdata/function/call/no_prelude/params_zero.carbon
  31. 0 2
      toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon
  32. 0 8
      toolchain/check/testdata/function/declaration/no_prelude/extern.carbon
  33. 8 12
      toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon
  34. 0 2
      toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon
  35. 28 20
      toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon
  36. 0 2
      toolchain/check/testdata/function/declaration/no_prelude/fail_todo_modifiers.carbon
  37. 3 15
      toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon
  38. 0 2
      toolchain/check/testdata/function/declaration/no_prelude/simple.carbon
  39. 0 8
      toolchain/check/testdata/function/definition/no_prelude/extern.carbon
  40. 69 51
      toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon
  41. 0 2
      toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon
  42. 0 2
      toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon
  43. 5 25
      toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon
  44. 0 2
      toolchain/check/testdata/function/definition/no_prelude/order.carbon
  45. 0 2
      toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon
  46. 0 2
      toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon
  47. 0 2
      toolchain/check/testdata/function/generic/no_prelude/type_param.carbon
  48. 0 2
      toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon
  49. 150 0
      toolchain/check/testdata/impl/lookup/no_prelude/import.carbon
  50. 16 6
      toolchain/check/testdata/impl/no_prelude/basic.carbon
  51. 166 0
      toolchain/check/testdata/impl/no_prelude/import_self.carbon
  52. 27 14
      toolchain/check/testdata/impl/no_prelude/self_in_class.carbon
  53. 35 31
      toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon
  54. 0 2
      toolchain/check/testdata/interface/no_prelude/as_type.carbon
  55. 0 2
      toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon
  56. 0 2
      toolchain/check/testdata/interface/no_prelude/basic.carbon
  57. 0 2
      toolchain/check/testdata/interface/no_prelude/default_fn.carbon
  58. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon
  59. 1 1
      toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon
  60. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon
  61. 1 1
      toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon
  62. 1 3
      toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon
  63. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon
  64. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon
  65. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon
  66. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon
  67. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon
  68. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_todo_generic.carbon
  69. 0 2
      toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon
  70. 29 33
      toolchain/check/testdata/interface/no_prelude/import.carbon
  71. 0 2
      toolchain/check/testdata/interface/no_prelude/self.carbon
  72. 0 2
      toolchain/check/testdata/struct/no_prelude/empty.carbon
  73. 0 2
      toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon
  74. 0 2
      toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon
  75. 0 2
      toolchain/check/testdata/tuples/no_prelude/empty.carbon
  76. 12 13
      toolchain/check/testdata/tuples/no_prelude/fail_assign_empty.carbon
  77. 7 8
      toolchain/check/testdata/tuples/no_prelude/fail_assign_to_empty.carbon
  78. 0 46
      toolchain/check/testdata/var/fail_duplicate_decl.carbon
  79. 0 38
      toolchain/check/testdata/var/fail_generic.carbon
  80. 0 20
      toolchain/check/testdata/var/global_decl.carbon
  81. 0 31
      toolchain/check/testdata/var/global_decl_with_init.carbon
  82. 0 38
      toolchain/check/testdata/var/global_lookup.carbon
  83. 0 47
      toolchain/check/testdata/var/global_lookup_in_scope.carbon
  84. 0 63
      toolchain/check/testdata/var/import.carbon
  85. 0 36
      toolchain/check/testdata/var/lookup.carbon
  86. 9 5
      toolchain/check/testdata/var/no_prelude/decl.carbon
  87. 11 8
      toolchain/check/testdata/var/no_prelude/decl_with_init.carbon
  88. 53 0
      toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon
  89. 41 0
      toolchain/check/testdata/var/no_prelude/fail_generic.carbon
  90. 11 10
      toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon
  91. 12 8
      toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon
  92. 17 11
      toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon
  93. 32 22
      toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon
  94. 18 13
      toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon
  95. 10 6
      toolchain/check/testdata/var/no_prelude/fail_todo_modifiers.carbon
  96. 26 0
      toolchain/check/testdata/var/no_prelude/global_decl.carbon
  97. 41 0
      toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon
  98. 56 0
      toolchain/check/testdata/var/no_prelude/global_lookup.carbon
  99. 65 0
      toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon
  100. 72 0
      toolchain/check/testdata/var/no_prelude/import.carbon

+ 0 - 46
toolchain/check/testdata/alias/fail_aliased_name_in_diag.carbon

@@ -1,46 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-class C { var v: i32; }
-alias b = C;
-// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: ERROR: Cannot implicitly convert from `i32` to `C`.
-// CHECK:STDERR: let c: b = 2;
-// CHECK:STDERR: ^~~~~~~~~~~~~
-let c: b = 2;
-
-// CHECK:STDOUT: --- fail_aliased_name_in_diag.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %C: type = class_type @C [template]
-// CHECK:STDOUT:   %.1: type = unbound_element_type C, i32 [template]
-// CHECK:STDOUT:   %.2: type = struct_type {.v: i32} [template]
-// CHECK:STDOUT:   %.3: type = ptr_type {.v: i32} [template]
-// CHECK:STDOUT:   %.4: i32 = int_literal 2 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .C = %C.decl
-// CHECK:STDOUT:     .b = %b
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
-// CHECK:STDOUT:   %C.ref: type = name_ref C, %C.decl [template = constants.%C]
-// CHECK:STDOUT:   %b: type = bind_alias b, %C.decl [template = constants.%C]
-// CHECK:STDOUT:   %b.ref: type = name_ref b, %b [template = constants.%C]
-// CHECK:STDOUT:   %.loc12: i32 = int_literal 2 [template = constants.%.4]
-// CHECK:STDOUT:   %c: C = bind_name c, <error>
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @C {
-// CHECK:STDOUT:   %.loc7: <unbound element of class C> = field_decl v, element0 [template]
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%C
-// CHECK:STDOUT:   .v = %.loc7
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 50
toolchain/check/testdata/alias/fail_not_constant.carbon

@@ -1,50 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-fn F() {
-  var a: i32 = 0;
-  var b: i32* = &a;
-  // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: ERROR: Alias initializer must be a name reference.
-  // CHECK:STDERR:   alias c = *b;
-  // CHECK:STDERR:             ^~
-  alias c = *b;
-}
-
-// CHECK:STDOUT: --- fail_not_constant.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.2: type = ptr_type i32 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .F = %F
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %a.var: ref i32 = var a
-// CHECK:STDOUT:   %a: ref i32 = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign %a.var, %.loc8
-// CHECK:STDOUT:   %.loc9_13: type = ptr_type i32 [template = constants.%.2]
-// CHECK:STDOUT:   %b.var: ref i32* = var b
-// CHECK:STDOUT:   %b: ref i32* = bind_name b, %b.var
-// CHECK:STDOUT:   %a.ref: ref i32 = name_ref a, %a
-// CHECK:STDOUT:   %.loc9_17: i32* = addr_of %a.ref
-// CHECK:STDOUT:   assign %b.var, %.loc9_17
-// CHECK:STDOUT:   %b.ref: ref i32* = name_ref b, %b
-// CHECK:STDOUT:   %.loc13_14: i32* = bind_value %b.ref
-// CHECK:STDOUT:   %.loc13_13: ref i32 = deref %.loc13_14
-// CHECK:STDOUT:   %c: <error> = bind_alias c, <error> [template = <error>]
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 80
toolchain/check/testdata/alias/in_namespace.carbon

@@ -1,80 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-class C { var v: i32; }
-
-namespace NS;
-alias NS.a = C;
-
-let b: NS.a = {.v = 0};
-
-fn F() -> NS.a {
-  return {.v = 0};
-}
-
-// CHECK:STDOUT: --- in_namespace.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %C: type = class_type @C [template]
-// CHECK:STDOUT:   %.1: type = unbound_element_type C, i32 [template]
-// CHECK:STDOUT:   %.2: type = struct_type {.v: i32} [template]
-// CHECK:STDOUT:   %.3: type = ptr_type {.v: i32} [template]
-// CHECK:STDOUT:   %.4: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.5: C = struct_value (%.4) [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .C = %C.decl
-// CHECK:STDOUT:     .NS = %NS
-// CHECK:STDOUT:     .F = %F
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
-// CHECK:STDOUT:   %NS: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %C.ref: type = name_ref C, %C.decl [template = constants.%C]
-// CHECK:STDOUT:   %a: type = bind_alias a, %C.decl [template = constants.%C]
-// CHECK:STDOUT:   %NS.ref.loc12: <namespace> = name_ref NS, %NS [template = %NS]
-// CHECK:STDOUT:   %a.ref.loc12: type = name_ref a, %a [template = constants.%C]
-// CHECK:STDOUT:   %.loc12_21: i32 = int_literal 0 [template = constants.%.4]
-// CHECK:STDOUT:   %.loc12_22.1: {.v: i32} = struct_literal (%.loc12_21)
-// CHECK:STDOUT:   %.loc12_22.2: ref C = temporary_storage
-// CHECK:STDOUT:   %.loc12_22.3: ref i32 = class_element_access %.loc12_22.2, element0
-// CHECK:STDOUT:   %.loc12_22.4: init i32 = initialize_from %.loc12_21 to %.loc12_22.3 [template = constants.%.4]
-// CHECK:STDOUT:   %.loc12_22.5: init C = class_init (%.loc12_22.4), %.loc12_22.2 [template = constants.%.5]
-// CHECK:STDOUT:   %.loc12_22.6: ref C = temporary %.loc12_22.2, %.loc12_22.5
-// CHECK:STDOUT:   %.loc12_23.1: ref C = converted %.loc12_22.1, %.loc12_22.6
-// CHECK:STDOUT:   %.loc12_23.2: C = bind_value %.loc12_23.1
-// CHECK:STDOUT:   %b: C = bind_name b, %.loc12_23.2
-// CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
-// CHECK:STDOUT:     %NS.ref.loc14: <namespace> = name_ref NS, %NS [template = %NS]
-// CHECK:STDOUT:     %a.ref.loc14: type = name_ref a, %a [template = constants.%C]
-// CHECK:STDOUT:     @F.%return: ref C = var <return slot>
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @C {
-// CHECK:STDOUT:   %.loc7: <unbound element of class C> = field_decl v, element0 [template]
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%C
-// CHECK:STDOUT:   .v = %.loc7
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F() -> %return: C {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc15_16: i32 = int_literal 0 [template = constants.%.4]
-// CHECK:STDOUT:   %.loc15_17.1: {.v: i32} = struct_literal (%.loc15_16)
-// CHECK:STDOUT:   %.loc15_17.2: ref i32 = class_element_access %return, element0
-// CHECK:STDOUT:   %.loc15_17.3: init i32 = initialize_from %.loc15_16 to %.loc15_17.2 [template = constants.%.4]
-// CHECK:STDOUT:   %.loc15_17.4: init C = class_init (%.loc15_17.3), %return [template = constants.%.5]
-// CHECK:STDOUT:   %.loc15_18: init C = converted %.loc15_17.1, %.loc15_17.4 [template = constants.%.5]
-// CHECK:STDOUT:   return %.loc15_18 to %return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 42
toolchain/check/testdata/alias/local.carbon

@@ -1,42 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-fn F() -> i32 {
-  var a: i32 = 0;
-  alias b = a;
-  return b;
-}
-
-// CHECK:STDOUT: --- local.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .F = %F
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
-// CHECK:STDOUT:     @F.%return: ref i32 = var <return slot>
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F() -> i32 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %a.var: ref i32 = var a
-// CHECK:STDOUT:   %a: ref i32 = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign %a.var, %.loc8
-// CHECK:STDOUT:   %a.ref: ref i32 = name_ref a, %a
-// CHECK:STDOUT:   %b: ref i32 = bind_alias b, %a
-// CHECK:STDOUT:   %b.ref: ref i32 = name_ref b, %b
-// CHECK:STDOUT:   %.loc10: i32 = bind_value %b.ref
-// CHECK:STDOUT:   return %.loc10
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 13 - 22
toolchain/check/testdata/alias/alias_of_alias.carbon → toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon

@@ -4,32 +4,29 @@
 //
 // AUTOUPDATE
 
-class C { var v: i32; }
+class C {}
 alias a = C;
 alias b = a;
 alias c = b;
-let d: c = {.v = 0};
+let d: c = {};
 
 // CHECK:STDOUT: --- alias_of_alias.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %C: type = class_type @C [template]
-// CHECK:STDOUT:   %.1: type = unbound_element_type C, i32 [template]
-// CHECK:STDOUT:   %.2: type = struct_type {.v: i32} [template]
-// CHECK:STDOUT:   %.3: type = ptr_type {.v: i32} [template]
-// CHECK:STDOUT:   %.4: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.5: C = struct_value (%.4) [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: C = struct_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .a = %a
 // CHECK:STDOUT:     .b = %b
 // CHECK:STDOUT:     .c = %c
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %C.ref: type = name_ref C, %C.decl [template = constants.%C]
 // CHECK:STDOUT:   %a: type = bind_alias a, %C.decl [template = constants.%C]
@@ -38,23 +35,17 @@ let d: c = {.v = 0};
 // CHECK:STDOUT:   %b.ref: type = name_ref b, %b [template = constants.%C]
 // CHECK:STDOUT:   %c: type = bind_alias c, %b [template = constants.%C]
 // CHECK:STDOUT:   %c.ref: type = name_ref c, %c [template = constants.%C]
-// CHECK:STDOUT:   %.loc11_18: i32 = int_literal 0 [template = constants.%.4]
-// CHECK:STDOUT:   %.loc11_19.1: {.v: i32} = struct_literal (%.loc11_18)
-// CHECK:STDOUT:   %.loc11_19.2: ref C = temporary_storage
-// CHECK:STDOUT:   %.loc11_19.3: ref i32 = class_element_access %.loc11_19.2, element0
-// CHECK:STDOUT:   %.loc11_19.4: init i32 = initialize_from %.loc11_18 to %.loc11_19.3 [template = constants.%.4]
-// CHECK:STDOUT:   %.loc11_19.5: init C = class_init (%.loc11_19.4), %.loc11_19.2 [template = constants.%.5]
-// CHECK:STDOUT:   %.loc11_19.6: ref C = temporary %.loc11_19.2, %.loc11_19.5
-// CHECK:STDOUT:   %.loc11_20.1: ref C = converted %.loc11_19.1, %.loc11_19.6
-// CHECK:STDOUT:   %.loc11_20.2: C = bind_value %.loc11_20.1
-// CHECK:STDOUT:   %d: C = bind_name d, %.loc11_20.2
+// CHECK:STDOUT:   %.loc11_13.1: {} = struct_literal ()
+// CHECK:STDOUT:   %.loc11_13.2: ref C = temporary_storage
+// CHECK:STDOUT:   %.loc11_13.3: init C = class_init (), %.loc11_13.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc11_13.4: ref C = temporary %.loc11_13.2, %.loc11_13.3
+// CHECK:STDOUT:   %.loc11_14.1: ref C = converted %.loc11_13.1, %.loc11_13.4
+// CHECK:STDOUT:   %.loc11_14.2: C = bind_value %.loc11_14.1
+// CHECK:STDOUT:   %d: C = bind_name d, %.loc11_14.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @C {
-// CHECK:STDOUT:   %.loc7: <unbound element of class C> = field_decl v, element0 [template]
-// CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .Self = constants.%C
-// CHECK:STDOUT:   .v = %.loc7
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 66 - 0
toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon

@@ -0,0 +1,66 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+class C {}
+class D {}
+
+alias c = C;
+var d: D = {};
+
+// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: ERROR: Cannot implicitly convert from `D` to `C`.
+// CHECK:STDERR: let c_var: c = d;
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
+let c_var: c = d;
+
+// CHECK:STDOUT: --- fail_aliased_name_in_diag.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %C: type = class_type @C [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %D: type = class_type @D [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: D = struct_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .C = %C.decl
+// CHECK:STDOUT:     .D = %D.decl
+// CHECK:STDOUT:     .c = %c
+// CHECK:STDOUT:     .d = %d
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
+// CHECK:STDOUT:   %D.decl: type = class_decl @D [template = constants.%D] {}
+// CHECK:STDOUT:   %C.ref: type = name_ref C, %C.decl [template = constants.%C]
+// CHECK:STDOUT:   %c: type = bind_alias c, %C.decl [template = constants.%C]
+// CHECK:STDOUT:   %D.ref: type = name_ref D, %D.decl [template = constants.%D]
+// CHECK:STDOUT:   %d.var: ref D = var d
+// CHECK:STDOUT:   %d: ref D = bind_name d, %d.var
+// CHECK:STDOUT:   %c.ref: type = name_ref c, %c [template = constants.%C]
+// CHECK:STDOUT:   %d.ref: ref D = name_ref d, %d
+// CHECK:STDOUT:   %c_var: C = bind_name c_var, <error>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: class @C {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = constants.%C
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: class @D {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = constants.%D
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc11_13.1: {} = struct_literal ()
+// CHECK:STDOUT:   %.loc11_13.2: init D = class_init (), file.%d.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc11_14: init D = converted %.loc11_13.1, %.loc11_13.2 [template = constants.%.4]
+// CHECK:STDOUT:   assign file.%d.var, %.loc11_14
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 12 - 11
toolchain/check/testdata/alias/fail_local_in_namespace.carbon → toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon

@@ -6,16 +6,16 @@
 
 namespace NS;
 
-fn F() -> bool {
+fn F() -> {} {
   // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: ERROR: Name `NS` not found.
-  // CHECK:STDERR:   alias NS.a = false;
+  // CHECK:STDERR:   alias NS.a = {};
   // CHECK:STDERR:         ^~
   // CHECK:STDERR:
   // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: ERROR: Alias initializer must be a name reference.
-  // CHECK:STDERR:   alias NS.a = false;
-  // CHECK:STDERR:                ^~~~~
+  // CHECK:STDERR:   alias NS.a = {};
+  // CHECK:STDERR:                ^~
   // CHECK:STDERR:
-  alias NS.a = false;
+  alias NS.a = {};
   // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: ERROR: Name `a` not found.
   // CHECK:STDERR:   return NS.a;
   // CHECK:STDERR:          ^~~~
@@ -25,25 +25,26 @@ fn F() -> bool {
 // CHECK:STDOUT: --- fail_local_in_namespace.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: bool = bool_literal false [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .NS = %NS
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %NS: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
-// CHECK:STDOUT:     @F.%return: ref bool = var <return slot>
+// CHECK:STDOUT:     %.loc9_12.1: {} = struct_literal ()
+// CHECK:STDOUT:     %.loc9_12.2: type = converted %.loc9_12.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     @F.%return: ref {} = var <return slot>
 // CHECK:STDOUT:   }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @F() -> bool {
+// CHECK:STDOUT: fn @F() -> {} {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc18_16: bool = bool_literal false [template = constants.%.1]
+// CHECK:STDOUT:   %.loc18_17: {} = struct_literal ()
 // CHECK:STDOUT:   %.loc18_9: <error> = bind_alias <invalid>, <error> [template = <error>]
 // CHECK:STDOUT:   %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
 // CHECK:STDOUT:   %a.ref: <error> = name_ref a, <error> [template = <error>]

+ 0 - 2
toolchain/check/testdata/alias/fail_modifiers.carbon → toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon

@@ -53,13 +53,11 @@ extern alias C = Class;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Class = %Class.decl
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:     .B = %B
 // CHECK:STDOUT:     .C = %C
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Class.decl: type = class_decl @Class [template = constants.%Class] {}
 // CHECK:STDOUT:   %Class.ref.loc34: type = name_ref Class, %Class.decl [template = constants.%Class]
 // CHECK:STDOUT:   %A: type = bind_alias A, %Class.decl [template = constants.%Class]

+ 21 - 16
toolchain/check/testdata/alias/fail_name_conflict.carbon → toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon

@@ -8,20 +8,20 @@ class C {}
 
 alias a = C;
 // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: ERROR: Duplicate name being declared in the same scope.
-// CHECK:STDERR: var a: i32 = 1;
+// CHECK:STDERR: var a: C = {};
 // CHECK:STDERR:     ^
 // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: Name is previously declared here.
 // CHECK:STDERR: alias a = C;
 // CHECK:STDERR:       ^
 // CHECK:STDERR:
-var a: i32 = 1;
+var a: C = {};
 
-var b: i32 = 2;
+var b: C = {};
 // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope.
 // CHECK:STDERR: alias b = C;
 // CHECK:STDERR:       ^
 // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: Name is previously declared here.
-// CHECK:STDERR: var b: i32 = 2;
+// CHECK:STDERR: var b: C = {};
 // CHECK:STDERR:     ^
 alias b = C;
 
@@ -30,25 +30,26 @@ alias b = C;
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %C: type = class_type @C [template]
 // CHECK:STDOUT:   %.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.2: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.3: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: C = struct_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .a = %a.loc9
 // CHECK:STDOUT:     .b = %b
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C]
 // CHECK:STDOUT:   %a.loc9: type = bind_alias a, %C.decl [template = constants.%C]
-// CHECK:STDOUT:   %a.var: ref i32 = var a
-// CHECK:STDOUT:   %a.loc17: ref i32 = bind_name a, %a.var
-// CHECK:STDOUT:   %b.var: ref i32 = var b
-// CHECK:STDOUT:   %b: ref i32 = bind_name b, %b.var
+// CHECK:STDOUT:   %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C]
+// CHECK:STDOUT:   %a.var: ref C = var a
+// CHECK:STDOUT:   %a.loc17: ref C = bind_name a, %a.var
+// CHECK:STDOUT:   %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C]
+// CHECK:STDOUT:   %b.var: ref C = var b
+// CHECK:STDOUT:   %b: ref C = bind_name b, %b.var
 // CHECK:STDOUT:   %C.ref.loc26: type = name_ref C, %C.decl [template = constants.%C]
 // CHECK:STDOUT:   %.loc26: type = bind_alias <invalid>, %C.decl [template = constants.%C]
 // CHECK:STDOUT: }
@@ -60,10 +61,14 @@ alias b = C;
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc17: i32 = int_literal 1 [template = constants.%.2]
-// CHECK:STDOUT:   assign file.%a.var, %.loc17
-// CHECK:STDOUT:   %.loc19: i32 = int_literal 2 [template = constants.%.3]
-// CHECK:STDOUT:   assign file.%b.var, %.loc19
+// CHECK:STDOUT:   %.loc17_13.1: {} = struct_literal ()
+// CHECK:STDOUT:   %.loc17_13.2: init C = class_init (), file.%a.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc17_14: init C = converted %.loc17_13.1, %.loc17_13.2 [template = constants.%.4]
+// CHECK:STDOUT:   assign file.%a.var, %.loc17_14
+// CHECK:STDOUT:   %.loc19_13.1: {} = struct_literal ()
+// CHECK:STDOUT:   %.loc19_13.2: init C = class_init (), file.%b.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc19_14: init C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%.4]
+// CHECK:STDOUT:   assign file.%b.var, %.loc19_14
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 55 - 0
toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon

@@ -0,0 +1,55 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+fn F() {
+  var a: () = ();
+  var b: ()* = &a;
+  // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: ERROR: Alias initializer must be a name reference.
+  // CHECK:STDERR:   alias c = *b;
+  // CHECK:STDERR:             ^~
+  alias c = *b;
+}
+
+// CHECK:STDOUT: --- fail_not_constant.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .F = %F
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {}
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc8_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_11.2: type = converted %.loc8_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %a.var: ref () = var a
+// CHECK:STDOUT:   %a: ref () = bind_name a, %a.var
+// CHECK:STDOUT:   %.loc8_16.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_16.2: init () = tuple_init () to %a.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc8_17: init () = converted %.loc8_16.1, %.loc8_16.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign %a.var, %.loc8_17
+// CHECK:STDOUT:   %.loc9_11: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc9_12.1: type = converted %.loc9_11, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc9_12.2: type = ptr_type () [template = constants.%.3]
+// CHECK:STDOUT:   %b.var: ref ()* = var b
+// CHECK:STDOUT:   %b: ref ()* = bind_name b, %b.var
+// CHECK:STDOUT:   %a.ref: ref () = name_ref a, %a
+// CHECK:STDOUT:   %.loc9_16: ()* = addr_of %a.ref
+// CHECK:STDOUT:   assign %b.var, %.loc9_16
+// CHECK:STDOUT:   %b.ref: ref ()* = name_ref b, %b
+// CHECK:STDOUT:   %.loc13_14: ()* = bind_value %b.ref
+// CHECK:STDOUT:   %.loc13_13: ref () = deref %.loc13_14
+// CHECK:STDOUT:   %c: <error> = bind_alias c, <error> [template = <error>]
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/alias/fail_todo_private.carbon → toolchain/check/testdata/alias/no_prelude/fail_todo_private.carbon

@@ -19,11 +19,9 @@ private alias A = C;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %C.ref: type = name_ref C, %C.decl [template = constants.%C]
 // CHECK:STDOUT:   %A: type = bind_alias A, %C.decl [template = constants.%C]

+ 55 - 46
toolchain/check/testdata/alias/import.carbon → toolchain/check/testdata/alias/no_prelude/import.carbon

@@ -36,7 +36,7 @@ var c: c_alias_alias*;
 
 library "var1" api;
 
-var a: i32 = 0;
+var a: () = ();
 
 alias a_alias = a;
 
@@ -48,7 +48,7 @@ import library "var1";
 
 alias a_alias_alias = a_alias;
 
-var b: i32 = a_alias;
+var b: () = a_alias;
 
 // --- fail_var3.carbon
 
@@ -58,11 +58,11 @@ library "var3" api;
 // CHECK:STDERR: import library "var2";
 // CHECK:STDERR: ^~~~~~
 // CHECK:STDERR: var2.carbon:8:5: ERROR: Semantics TODO: `Non-constant ImportRefUsed (comes up with var)`.
-// CHECK:STDERR: var b: i32 = a_alias;
+// CHECK:STDERR: var b: () = a_alias;
 // CHECK:STDERR:     ^
 import library "var2";
 
-var c: i32 = a_alias_alias;
+var c: () = a_alias_alias;
 
 // CHECK:STDOUT: --- class1.carbon
 // CHECK:STDOUT:
@@ -74,12 +74,10 @@ var c: i32 = a_alias_alias;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .c_alias = %c_alias
 // CHECK:STDOUT:     .a = %a
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C]
 // CHECK:STDOUT:   %c_alias: type = bind_alias c_alias, %C.decl [template = constants.%C]
@@ -107,16 +105,14 @@ var c: i32 = a_alias_alias;
 // CHECK:STDOUT:     .C = %import_ref.1
 // CHECK:STDOUT:     .c_alias = %import_ref.2
 // CHECK:STDOUT:     .a = %import_ref.3
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .c_alias_alias = %c_alias_alias
 // CHECK:STDOUT:     .b = %b
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+2, unloaded
-// CHECK:STDOUT:   %import_ref.2: type = import_ref ir1, inst+6, loc_12 [template = constants.%C]
-// CHECK:STDOUT:   %import_ref.3 = import_ref ir1, inst+11, unloaded
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+1, unloaded
+// CHECK:STDOUT:   %import_ref.2: type = import_ref ir1, inst+5, loc_12 [template = constants.%C]
+// CHECK:STDOUT:   %import_ref.3 = import_ref ir1, inst+10, unloaded
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
-// CHECK:STDOUT:   %import_ref.4 = import_ref ir1, inst+3, unloaded
+// CHECK:STDOUT:   %import_ref.4 = import_ref ir1, inst+2, unloaded
 // CHECK:STDOUT:   %c_alias.ref.loc6: type = name_ref c_alias, %import_ref.2 [template = constants.%C]
 // CHECK:STDOUT:   %c_alias_alias: type = bind_alias c_alias_alias, %import_ref.2 [template = constants.%C]
 // CHECK:STDOUT:   %c_alias.ref.loc8: type = name_ref c_alias, %import_ref.2 [template = constants.%C]
@@ -142,14 +138,12 @@ var c: i32 = a_alias_alias;
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
 // CHECK:STDOUT:     .c_alias_alias = %import_ref.1
 // CHECK:STDOUT:     .b = %import_ref.2
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .c = %c
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.1: type = import_ref ir1, inst+10, loc_11 [template = constants.%C]
-// CHECK:STDOUT:   %import_ref.2 = import_ref ir1, inst+15, unloaded
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref.1: type = import_ref ir1, inst+9, loc_11 [template = constants.%C]
+// CHECK:STDOUT:   %import_ref.2 = import_ref ir1, inst+14, unloaded
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
-// CHECK:STDOUT:   %import_ref.3 = import_ref ir1, inst+8, unloaded
+// CHECK:STDOUT:   %import_ref.3 = import_ref ir1, inst+7, unloaded
 // CHECK:STDOUT:   %c_alias_alias.ref: type = name_ref c_alias_alias, %import_ref.1 [template = constants.%C]
 // CHECK:STDOUT:   %.loc6: type = ptr_type C [template = constants.%.2]
 // CHECK:STDOUT:   %c.var: ref C* = var c
@@ -164,77 +158,92 @@ var c: i32 = a_alias_alias;
 // CHECK:STDOUT: --- var1.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .a = %a
 // CHECK:STDOUT:     .a_alias = %a_alias
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %a.var: ref i32 = var a
-// CHECK:STDOUT:   %a: ref i32 = bind_name a, %a.var
-// CHECK:STDOUT:   %a.ref: ref i32 = name_ref a, %a
-// CHECK:STDOUT:   %a_alias: ref i32 = bind_alias a_alias, %a
+// CHECK:STDOUT:   %.loc4_9.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %a.var: ref () = var a
+// CHECK:STDOUT:   %a: ref () = bind_name a, %a.var
+// CHECK:STDOUT:   %a.ref: ref () = name_ref a, %a
+// CHECK:STDOUT:   %a_alias: ref () = bind_alias a_alias, %a
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc4: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign file.%a.var, %.loc4
+// CHECK:STDOUT:   %.loc4_14.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc4_14.2: init () = tuple_init () to file.%a.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc4_15: init () = converted %.loc4_14.1, %.loc4_14.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign file.%a.var, %.loc4_15
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- var2.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
 // CHECK:STDOUT:     .a = %import_ref.1
 // CHECK:STDOUT:     .a_alias = %import_ref.2
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .a_alias_alias = %a_alias_alias
 // CHECK:STDOUT:     .b = %b
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+3, unloaded
-// CHECK:STDOUT:   %import_ref.2: ref i32 = import_ref ir1, inst+8, loc_12
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %a_alias.ref: ref i32 = name_ref a_alias, %import_ref.2
-// CHECK:STDOUT:   %a_alias_alias: ref i32 = bind_alias a_alias_alias, %import_ref.2
-// CHECK:STDOUT:   %b.var: ref i32 = var b
-// CHECK:STDOUT:   %b: ref i32 = bind_name b, %b.var
+// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+5, unloaded
+// CHECK:STDOUT:   %import_ref.2: ref () = import_ref ir1, inst+12, loc_12
+// CHECK:STDOUT:   %a_alias.ref: ref () = name_ref a_alias, %import_ref.2
+// CHECK:STDOUT:   %a_alias_alias: ref () = bind_alias a_alias_alias, %import_ref.2
+// CHECK:STDOUT:   %.loc8_9.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_9.2: type = converted %.loc8_9.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %b.var: ref () = var b
+// CHECK:STDOUT:   %b: ref () = bind_name b, %b.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %a_alias.ref: ref i32 = name_ref a_alias, file.%import_ref.2
-// CHECK:STDOUT:   %.loc8: i32 = bind_value %a_alias.ref
-// CHECK:STDOUT:   assign file.%b.var, %.loc8
+// CHECK:STDOUT:   %a_alias.ref: ref () = name_ref a_alias, file.%import_ref.2
+// CHECK:STDOUT:   %.loc8_13: init () = tuple_init () to file.%b.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc8_20: init () = converted %a_alias.ref, %.loc8_13 [template = constants.%.2]
+// CHECK:STDOUT:   assign file.%b.var, %.loc8_20
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- fail_var3.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
 // CHECK:STDOUT:     .a_alias_alias = %import_ref.1
 // CHECK:STDOUT:     .b = %import_ref.2
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .c = %c
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.1: ref i32 = import_ref ir1, inst+5, loc_14 [template = <error>]
-// CHECK:STDOUT:   %import_ref.2 = import_ref ir1, inst+7, unloaded
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %c.var: ref i32 = var c
-// CHECK:STDOUT:   %c: ref i32 = bind_name c, %c.var
+// CHECK:STDOUT:   %import_ref.1: ref () = import_ref ir1, inst+5, loc_15 [template = <error>]
+// CHECK:STDOUT:   %import_ref.2 = import_ref ir1, inst+9, unloaded
+// CHECK:STDOUT:   %.loc12_9.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %c.var: ref () = var c
+// CHECK:STDOUT:   %c: ref () = bind_name c, %c.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %a_alias_alias.ref: ref i32 = name_ref a_alias_alias, file.%import_ref.1 [template = <error>]
-// CHECK:STDOUT:   %.loc12: i32 = bind_value %a_alias_alias.ref
-// CHECK:STDOUT:   assign file.%c.var, %.loc12
+// CHECK:STDOUT:   %a_alias_alias.ref: ref () = name_ref a_alias_alias, file.%import_ref.1 [template = <error>]
+// CHECK:STDOUT:   %.loc12_13: init () = tuple_init () to file.%c.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc12_26: init () = converted %a_alias_alias.ref, %.loc12_13 [template = constants.%.2]
+// CHECK:STDOUT:   assign file.%c.var, %.loc12_26
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 51 - 50
toolchain/check/testdata/alias/import_order.carbon → toolchain/check/testdata/alias/no_prelude/import_order.carbon

@@ -8,7 +8,7 @@
 
 library "a" api;
 
-class C { var v: i32; }
+class C { var v: (); }
 alias a = C;
 alias b = a;
 alias c = b;
@@ -21,7 +21,7 @@ library "b" api;
 import library "a";
 
 // Access imports in reverse order of export.
-var d_val: d = {.v = 0};
+var d_val: d = {.v = ()};
 var c_val: c = {.v = d_val.v};
 var b_val: b = {.v = c_val.v};
 var a_val: a = {.v = b_val.v};
@@ -30,20 +30,19 @@ var a_val: a = {.v = b_val.v};
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %C: type = class_type @C [template]
-// CHECK:STDOUT:   %.1: type = unbound_element_type C, i32 [template]
-// CHECK:STDOUT:   %.2: type = struct_type {.v: i32} [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = unbound_element_type C, () [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.v: ()} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .a = %a
 // CHECK:STDOUT:     .b = %b
 // CHECK:STDOUT:     .c = %c
 // CHECK:STDOUT:     .d = %d
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %C.ref: type = name_ref C, %C.decl [template = constants.%C]
 // CHECK:STDOUT:   %a: type = bind_alias a, %C.decl [template = constants.%C]
@@ -56,22 +55,25 @@ var a_val: a = {.v = b_val.v};
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @C {
-// CHECK:STDOUT:   %.loc4: <unbound element of class C> = field_decl v, element0 [template]
+// CHECK:STDOUT:   %.loc4_19.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc4_19.2: type = converted %.loc4_19.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc4_16: <unbound element of class C> = field_decl v, element0 [template]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .Self = constants.%C
-// CHECK:STDOUT:   .v = %.loc4
+// CHECK:STDOUT:   .v = %.loc4_16
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- b.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %C: type = class_type @C [template]
-// CHECK:STDOUT:   %.1: type = struct_type {.v: i32} [template]
-// CHECK:STDOUT:   %.2: type = ptr_type {.v: i32} [template]
-// CHECK:STDOUT:   %.3: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.4: C = struct_value (%.3) [template]
-// CHECK:STDOUT:   %.5: type = unbound_element_type C, i32 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = struct_type {.v: ()} [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {.v: ()} [template]
+// CHECK:STDOUT:   %.4: () = tuple_value () [template]
+// CHECK:STDOUT:   %.5: C = struct_value (%.4) [template]
+// CHECK:STDOUT:   %.6: type = unbound_element_type C, () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -81,21 +83,19 @@ var a_val: a = {.v = b_val.v};
 // CHECK:STDOUT:     .b = %import_ref.3
 // CHECK:STDOUT:     .c = %import_ref.4
 // CHECK:STDOUT:     .d = %import_ref.5
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .d_val = %d_val
 // CHECK:STDOUT:     .c_val = %c_val
 // CHECK:STDOUT:     .b_val = %b_val
 // CHECK:STDOUT:     .a_val = %a_val
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+2, unloaded
-// CHECK:STDOUT:   %import_ref.2: type = import_ref ir1, inst+10, loc_51 [template = constants.%C]
-// CHECK:STDOUT:   %import_ref.3: type = import_ref ir1, inst+12, loc_37 [template = constants.%C]
-// CHECK:STDOUT:   %import_ref.4: type = import_ref ir1, inst+14, loc_23 [template = constants.%C]
-// CHECK:STDOUT:   %import_ref.5: type = import_ref ir1, inst+16, loc_11 [template = constants.%C]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+1, unloaded
+// CHECK:STDOUT:   %import_ref.2: type = import_ref ir1, inst+12, loc_52 [template = constants.%C]
+// CHECK:STDOUT:   %import_ref.3: type = import_ref ir1, inst+14, loc_38 [template = constants.%C]
+// CHECK:STDOUT:   %import_ref.4: type = import_ref ir1, inst+16, loc_24 [template = constants.%C]
+// CHECK:STDOUT:   %import_ref.5: type = import_ref ir1, inst+18, loc_11 [template = constants.%C]
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
-// CHECK:STDOUT:   %import_ref.6: <unbound element of class C> = import_ref ir1, inst+5, loc_31 [template = imports.%.1]
-// CHECK:STDOUT:   %import_ref.7 = import_ref ir1, inst+3, unloaded
+// CHECK:STDOUT:   %import_ref.6: <unbound element of class C> = import_ref ir1, inst+7, loc_32 [template = imports.%.1]
+// CHECK:STDOUT:   %import_ref.7 = import_ref ir1, inst+2, unloaded
 // CHECK:STDOUT:   %d.ref: type = name_ref d, %import_ref.5 [template = constants.%C]
 // CHECK:STDOUT:   %d_val.var: ref C = var d_val
 // CHECK:STDOUT:   %d_val: ref C = bind_name d_val, %d_val.var
@@ -118,42 +118,43 @@ var a_val: a = {.v = b_val.v};
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7_22: i32 = int_literal 0 [template = constants.%.3]
-// CHECK:STDOUT:   %.loc7_23.1: {.v: i32} = struct_literal (%.loc7_22)
-// CHECK:STDOUT:   %.loc7_23.2: ref i32 = class_element_access file.%d_val.var, element0
-// CHECK:STDOUT:   %.loc7_23.3: init i32 = initialize_from %.loc7_22 to %.loc7_23.2 [template = constants.%.3]
-// CHECK:STDOUT:   %.loc7_23.4: init C = class_init (%.loc7_23.3), file.%d_val.var [template = constants.%.4]
-// CHECK:STDOUT:   %.loc7_24: init C = converted %.loc7_23.1, %.loc7_23.4 [template = constants.%.4]
-// CHECK:STDOUT:   assign file.%d_val.var, %.loc7_24
+// CHECK:STDOUT:   %.loc7_23.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_24.1: {.v: ()} = struct_literal (%.loc7_23.1)
+// CHECK:STDOUT:   %.loc7_24.2: ref () = class_element_access file.%d_val.var, element0
+// CHECK:STDOUT:   %.loc7_23.2: init () = tuple_init () to %.loc7_24.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_24.3: init () = converted %.loc7_23.1, %.loc7_23.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_24.4: init C = class_init (%.loc7_24.3), file.%d_val.var [template = constants.%.5]
+// CHECK:STDOUT:   %.loc7_25: init C = converted %.loc7_24.1, %.loc7_24.4 [template = constants.%.5]
+// CHECK:STDOUT:   assign file.%d_val.var, %.loc7_25
 // CHECK:STDOUT:   %d_val.ref: ref C = name_ref d_val, file.%d_val
 // CHECK:STDOUT:   %v.ref.loc8: <unbound element of class C> = name_ref v, file.%import_ref.6 [template = imports.%.1]
-// CHECK:STDOUT:   %.loc8_27.1: ref i32 = class_element_access %d_val.ref, element0
-// CHECK:STDOUT:   %.loc8_29.1: {.v: i32} = struct_literal (%.loc8_27.1)
-// CHECK:STDOUT:   %.loc8_27.2: i32 = bind_value %.loc8_27.1
-// CHECK:STDOUT:   %.loc8_29.2: ref i32 = class_element_access file.%c_val.var, element0
-// CHECK:STDOUT:   %.loc8_29.3: init i32 = initialize_from %.loc8_27.2 to %.loc8_29.2
-// CHECK:STDOUT:   %.loc8_29.4: init C = class_init (%.loc8_29.3), file.%c_val.var
-// CHECK:STDOUT:   %.loc8_30: init C = converted %.loc8_29.1, %.loc8_29.4
+// CHECK:STDOUT:   %.loc8_27.1: ref () = class_element_access %d_val.ref, element0
+// CHECK:STDOUT:   %.loc8_29.1: {.v: ()} = struct_literal (%.loc8_27.1)
+// CHECK:STDOUT:   %.loc8_29.2: ref () = class_element_access file.%c_val.var, element0
+// CHECK:STDOUT:   %.loc8_27.2: init () = tuple_init () to %.loc8_29.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc8_29.3: init () = converted %.loc8_27.1, %.loc8_27.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc8_29.4: init C = class_init (%.loc8_29.3), file.%c_val.var [template = constants.%.5]
+// CHECK:STDOUT:   %.loc8_30: init C = converted %.loc8_29.1, %.loc8_29.4 [template = constants.%.5]
 // CHECK:STDOUT:   assign file.%c_val.var, %.loc8_30
 // CHECK:STDOUT:   %c_val.ref: ref C = name_ref c_val, file.%c_val
 // CHECK:STDOUT:   %v.ref.loc9: <unbound element of class C> = name_ref v, file.%import_ref.6 [template = imports.%.1]
-// CHECK:STDOUT:   %.loc9_27.1: ref i32 = class_element_access %c_val.ref, element0
-// CHECK:STDOUT:   %.loc9_29.1: {.v: i32} = struct_literal (%.loc9_27.1)
-// CHECK:STDOUT:   %.loc9_27.2: i32 = bind_value %.loc9_27.1
-// CHECK:STDOUT:   %.loc9_29.2: ref i32 = class_element_access file.%b_val.var, element0
-// CHECK:STDOUT:   %.loc9_29.3: init i32 = initialize_from %.loc9_27.2 to %.loc9_29.2
-// CHECK:STDOUT:   %.loc9_29.4: init C = class_init (%.loc9_29.3), file.%b_val.var
-// CHECK:STDOUT:   %.loc9_30: init C = converted %.loc9_29.1, %.loc9_29.4
+// CHECK:STDOUT:   %.loc9_27.1: ref () = class_element_access %c_val.ref, element0
+// CHECK:STDOUT:   %.loc9_29.1: {.v: ()} = struct_literal (%.loc9_27.1)
+// CHECK:STDOUT:   %.loc9_29.2: ref () = class_element_access file.%b_val.var, element0
+// CHECK:STDOUT:   %.loc9_27.2: init () = tuple_init () to %.loc9_29.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc9_29.3: init () = converted %.loc9_27.1, %.loc9_27.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc9_29.4: init C = class_init (%.loc9_29.3), file.%b_val.var [template = constants.%.5]
+// CHECK:STDOUT:   %.loc9_30: init C = converted %.loc9_29.1, %.loc9_29.4 [template = constants.%.5]
 // CHECK:STDOUT:   assign file.%b_val.var, %.loc9_30
 // CHECK:STDOUT:   %b_val.ref: ref C = name_ref b_val, file.%b_val
 // CHECK:STDOUT:   %v.ref.loc10: <unbound element of class C> = name_ref v, file.%import_ref.6 [template = imports.%.1]
-// CHECK:STDOUT:   %.loc10_27.1: ref i32 = class_element_access %b_val.ref, element0
-// CHECK:STDOUT:   %.loc10_29.1: {.v: i32} = struct_literal (%.loc10_27.1)
-// CHECK:STDOUT:   %.loc10_27.2: i32 = bind_value %.loc10_27.1
-// CHECK:STDOUT:   %.loc10_29.2: ref i32 = class_element_access file.%a_val.var, element0
-// CHECK:STDOUT:   %.loc10_29.3: init i32 = initialize_from %.loc10_27.2 to %.loc10_29.2
-// CHECK:STDOUT:   %.loc10_29.4: init C = class_init (%.loc10_29.3), file.%a_val.var
-// CHECK:STDOUT:   %.loc10_30: init C = converted %.loc10_29.1, %.loc10_29.4
+// CHECK:STDOUT:   %.loc10_27.1: ref () = class_element_access %b_val.ref, element0
+// CHECK:STDOUT:   %.loc10_29.1: {.v: ()} = struct_literal (%.loc10_27.1)
+// CHECK:STDOUT:   %.loc10_29.2: ref () = class_element_access file.%a_val.var, element0
+// CHECK:STDOUT:   %.loc10_27.2: init () = tuple_init () to %.loc10_29.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc10_29.3: init () = converted %.loc10_27.1, %.loc10_27.2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc10_29.4: init C = class_init (%.loc10_29.3), file.%a_val.var [template = constants.%.5]
+// CHECK:STDOUT:   %.loc10_30: init C = converted %.loc10_29.1, %.loc10_29.4 [template = constants.%.5]
 // CHECK:STDOUT:   assign file.%a_val.var, %.loc10_30
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 83 - 0
toolchain/check/testdata/alias/no_prelude/in_namespace.carbon

@@ -0,0 +1,83 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+class C { var v: (); }
+
+namespace NS;
+alias NS.a = C;
+
+let b: NS.a = {.v = ()};
+
+fn F() -> NS.a {
+  return {.v = ()};
+}
+
+// CHECK:STDOUT: --- in_namespace.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %C: type = class_type @C [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = unbound_element_type C, () [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.v: ()} [template]
+// CHECK:STDOUT:   %.4: type = ptr_type {.v: ()} [template]
+// CHECK:STDOUT:   %.5: () = tuple_value () [template]
+// CHECK:STDOUT:   %.6: C = struct_value (%.5) [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .C = %C.decl
+// CHECK:STDOUT:     .NS = %NS
+// CHECK:STDOUT:     .F = %F
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
+// CHECK:STDOUT:   %NS: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .a = %a
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %C.ref: type = name_ref C, %C.decl [template = constants.%C]
+// CHECK:STDOUT:   %a: type = bind_alias a, %C.decl [template = constants.%C]
+// CHECK:STDOUT:   %NS.ref.loc12: <namespace> = name_ref NS, %NS [template = %NS]
+// CHECK:STDOUT:   %a.ref.loc12: type = name_ref a, %a [template = constants.%C]
+// CHECK:STDOUT:   %.loc12_22.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc12_23.1: {.v: ()} = struct_literal (%.loc12_22.1)
+// CHECK:STDOUT:   %.loc12_23.2: ref C = temporary_storage
+// CHECK:STDOUT:   %.loc12_23.3: ref () = class_element_access %.loc12_23.2, element0
+// CHECK:STDOUT:   %.loc12_22.2: init () = tuple_init () to %.loc12_23.3 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc12_23.4: init () = converted %.loc12_22.1, %.loc12_22.2 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc12_23.5: init C = class_init (%.loc12_23.4), %.loc12_23.2 [template = constants.%.6]
+// CHECK:STDOUT:   %.loc12_23.6: ref C = temporary %.loc12_23.2, %.loc12_23.5
+// CHECK:STDOUT:   %.loc12_24.1: ref C = converted %.loc12_23.1, %.loc12_23.6
+// CHECK:STDOUT:   %.loc12_24.2: C = bind_value %.loc12_24.1
+// CHECK:STDOUT:   %b: C = bind_name b, %.loc12_24.2
+// CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
+// CHECK:STDOUT:     %NS.ref.loc14: <namespace> = name_ref NS, %NS [template = %NS]
+// CHECK:STDOUT:     %a.ref.loc14: type = name_ref a, %a [template = constants.%C]
+// CHECK:STDOUT:     @F.%return: ref C = var <return slot>
+// CHECK:STDOUT:   }
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: class @C {
+// CHECK:STDOUT:   %.loc7_19.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_19.2: type = converted %.loc7_19.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc7_16: <unbound element of class C> = field_decl v, element0 [template]
+// CHECK:STDOUT:
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = constants.%C
+// CHECK:STDOUT:   .v = %.loc7_16
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F() -> %return: C {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc15_17.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc15_18.1: {.v: ()} = struct_literal (%.loc15_17.1)
+// CHECK:STDOUT:   %.loc15_18.2: ref () = class_element_access %return, element0
+// CHECK:STDOUT:   %.loc15_17.2: init () = tuple_init () to %.loc15_18.2 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc15_18.3: init () = converted %.loc15_17.1, %.loc15_17.2 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc15_18.4: init C = class_init (%.loc15_18.3), %return [template = constants.%.6]
+// CHECK:STDOUT:   %.loc15_19: init C = converted %.loc15_18.1, %.loc15_18.4 [template = constants.%.6]
+// CHECK:STDOUT:   return %.loc15_19 to %return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 48 - 0
toolchain/check/testdata/alias/no_prelude/local.carbon

@@ -0,0 +1,48 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+fn F() -> () {
+  var a: () = ();
+  alias b = a;
+  return b;
+}
+
+// CHECK:STDOUT: --- local.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .F = %F
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
+// CHECK:STDOUT:     %.loc7_12.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc7_12.2: type = converted %.loc7_12.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     @F.%return: ref () = var <return slot>
+// CHECK:STDOUT:   }
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F() -> () {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc8_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_11.2: type = converted %.loc8_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %a.var: ref () = var a
+// CHECK:STDOUT:   %a: ref () = bind_name a, %a.var
+// CHECK:STDOUT:   %.loc8_16.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_16.2: init () = tuple_init () to %a.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc8_17: init () = converted %.loc8_16.1, %.loc8_16.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign %a.var, %.loc8_17
+// CHECK:STDOUT:   %a.ref: ref () = name_ref a, %a
+// CHECK:STDOUT:   %b: ref () = bind_alias b, %a
+// CHECK:STDOUT:   %b.ref: ref () = name_ref b, %b
+// CHECK:STDOUT:   %.loc10_10: () = tuple_value () [template = constants.%.2]
+// CHECK:STDOUT:   %.loc10_11: () = converted %b.ref, %.loc10_10 [template = constants.%.2]
+// CHECK:STDOUT:   return %.loc10_11
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/as/tuple.carbon → toolchain/check/testdata/as/no_prelude/tuple.carbon

@@ -35,13 +35,11 @@ fn Var() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .X = %X.decl
 // CHECK:STDOUT:     .Make = %Make
 // CHECK:STDOUT:     .Let = %Let
 // CHECK:STDOUT:     .Var = %Var
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %X.decl: type = class_decl @X [template = constants.%X] {}
 // CHECK:STDOUT:   %Make: <function> = fn_decl @Make [template] {
 // CHECK:STDOUT:     %X.ref: type = name_ref X, %X.decl [template = constants.%X]

+ 1 - 4
toolchain/check/testdata/basics/empty.carbon → toolchain/check/testdata/basics/no_prelude/empty.carbon

@@ -7,9 +7,6 @@
 // CHECK:STDOUT: --- empty.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 4
toolchain/check/testdata/basics/empty_decl.carbon → toolchain/check/testdata/basics/no_prelude/empty_decl.carbon

@@ -9,9 +9,6 @@
 // CHECK:STDOUT: --- empty_decl.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/basics/fail_name_lookup.carbon → toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon

@@ -15,10 +15,8 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 0
toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon → toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon


+ 0 - 0
toolchain/check/testdata/basics/multifile_raw_ir.carbon → toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon


+ 0 - 0
toolchain/check/testdata/basics/raw_and_textual_ir.carbon → toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon


+ 0 - 0
toolchain/check/testdata/basics/raw_identifier.carbon → toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon


+ 0 - 0
toolchain/check/testdata/basics/raw_ir.carbon → toolchain/check/testdata/basics/no_prelude/raw_ir.carbon


+ 0 - 0
toolchain/check/testdata/basics/textual_ir.carbon → toolchain/check/testdata/basics/no_prelude/textual_ir.carbon


+ 0 - 0
toolchain/check/testdata/basics/verbose.carbon → toolchain/check/testdata/basics/no_prelude/verbose.carbon


+ 17 - 12
toolchain/check/testdata/function/call/alias.carbon → toolchain/check/testdata/function/call/no_prelude/alias.carbon

@@ -4,48 +4,53 @@
 //
 // AUTOUPDATE
 
-fn A() -> i32 { return 0; }
+fn A() -> () { return (); }
 
 alias B = A;
 
 fn Main() {
-  var b: i32 = B();
+  var b: () = B();
 }
 
 // CHECK:STDOUT: --- alias.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:     .B = %B
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {
-// CHECK:STDOUT:     @A.%return: ref i32 = var <return slot>
+// CHECK:STDOUT:     %.loc7_12.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc7_12.2: type = converted %.loc7_12.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     @A.%return: ref () = var <return slot>
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %A.ref: <function> = name_ref A, %A [template = %A]
 // CHECK:STDOUT:   %B: <function> = bind_alias B, %A [template = %A]
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @A() -> i32 {
+// CHECK:STDOUT: fn @A() -> () {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   return %.loc7
+// CHECK:STDOUT:   %.loc7_24.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_24.2: () = tuple_value () [template = constants.%.2]
+// CHECK:STDOUT:   %.loc7_25: () = converted %.loc7_24.1, %.loc7_24.2 [template = constants.%.2]
+// CHECK:STDOUT:   return %.loc7_25
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %b.var: ref i32 = var b
-// CHECK:STDOUT:   %b: ref i32 = bind_name b, %b.var
+// CHECK:STDOUT:   %.loc12_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc12_11.2: type = converted %.loc12_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %b.var: ref () = var b
+// CHECK:STDOUT:   %b: ref () = bind_name b, %b.var
 // CHECK:STDOUT:   %B.ref: <function> = name_ref B, file.%B [template = file.%A]
-// CHECK:STDOUT:   %A.call: init i32 = call %B.ref()
+// CHECK:STDOUT:   %A.call: init () = call %B.ref()
 // CHECK:STDOUT:   assign %b.var, %A.call
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 0 - 2
toolchain/check/testdata/function/call/empty_struct.carbon → toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon

@@ -22,11 +22,9 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Echo = %Echo
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Echo: <function> = fn_decl @Echo [template] {
 // CHECK:STDOUT:     %.loc7_13.1: {} = struct_literal ()
 // CHECK:STDOUT:     %.loc7_13.2: type = converted %.loc7_13.1, constants.%.1 [template = constants.%.1]

+ 0 - 2
toolchain/check/testdata/function/call/empty_tuple.carbon → toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon

@@ -21,11 +21,9 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Echo = %Echo
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Echo: <function> = fn_decl @Echo [template] {
 // CHECK:STDOUT:     %.loc7_13.1: () = tuple_literal ()
 // CHECK:STDOUT:     %.loc7_13.2: type = converted %.loc7_13.1, constants.%.1 [template = constants.%.1]

+ 0 - 2
toolchain/check/testdata/function/call/params_zero.carbon → toolchain/check/testdata/function/call/no_prelude/params_zero.carbon

@@ -18,11 +18,9 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Foo = %Foo
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Foo: <function> = fn_decl @Foo [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }

+ 0 - 2
toolchain/check/testdata/function/call/return_implicit.carbon → toolchain/check/testdata/function/call/no_prelude/return_implicit.carbon

@@ -19,11 +19,9 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .MakeImplicitEmptyTuple = %MakeImplicitEmptyTuple
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %MakeImplicitEmptyTuple: <function> = fn_decl @MakeImplicitEmptyTuple [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }

+ 0 - 8
toolchain/check/testdata/function/declaration/extern.carbon → toolchain/check/testdata/function/declaration/no_prelude/extern.carbon

@@ -56,10 +56,8 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -69,10 +67,8 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F.loc4
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F.loc4: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %F.loc12: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }
@@ -83,10 +79,8 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F.loc12
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F.loc4: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %F.loc12: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }
@@ -102,10 +96,8 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 8 - 12
toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon → toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon

@@ -81,7 +81,6 @@ fn CallFAndGIncomplete() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .D = %D.decl.loc5
 // CHECK:STDOUT:     .ReturnCUnused = %ReturnCUnused
@@ -90,7 +89,6 @@ fn CallFAndGIncomplete() {
 // CHECK:STDOUT:     .ReturnDUsed = %ReturnDUsed
 // CHECK:STDOUT:     .Call = %Call
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %D.decl.loc5: type = class_decl @D [template = constants.%D] {}
 // CHECK:STDOUT:   %ReturnCUnused: <function> = fn_decl @ReturnCUnused [template] {
@@ -156,19 +154,17 @@ fn CallFAndGIncomplete() {
 // CHECK:STDOUT:     .ReturnDUnused = %import_ref.5
 // CHECK:STDOUT:     .ReturnDUsed = %import_ref.6
 // CHECK:STDOUT:     .Call = %import_ref.7
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .CallFAndGIncomplete = %CallFAndGIncomplete
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+2, unloaded
-// CHECK:STDOUT:   %import_ref.2 = import_ref ir1, inst+4, unloaded
-// CHECK:STDOUT:   %import_ref.3: <function> = import_ref ir1, inst+8, loc_14 [template = imports.%ReturnCUnused]
-// CHECK:STDOUT:   %import_ref.4: <function> = import_ref ir1, inst+11, loc_18 [template = imports.%ReturnCUsed]
-// CHECK:STDOUT:   %import_ref.5: <function> = import_ref ir1, inst+14, loc_22 [template = imports.%ReturnDUnused]
-// CHECK:STDOUT:   %import_ref.6: <function> = import_ref ir1, inst+17, loc_26 [template = imports.%ReturnDUsed]
-// CHECK:STDOUT:   %import_ref.7 = import_ref ir1, inst+18, unloaded
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+1, unloaded
+// CHECK:STDOUT:   %import_ref.2 = import_ref ir1, inst+3, unloaded
+// CHECK:STDOUT:   %import_ref.3: <function> = import_ref ir1, inst+7, loc_14 [template = imports.%ReturnCUnused]
+// CHECK:STDOUT:   %import_ref.4: <function> = import_ref ir1, inst+10, loc_18 [template = imports.%ReturnCUsed]
+// CHECK:STDOUT:   %import_ref.5: <function> = import_ref ir1, inst+13, loc_22 [template = imports.%ReturnDUnused]
+// CHECK:STDOUT:   %import_ref.6: <function> = import_ref ir1, inst+16, loc_26 [template = imports.%ReturnDUsed]
+// CHECK:STDOUT:   %import_ref.7 = import_ref ir1, inst+17, unloaded
 // CHECK:STDOUT:   %CallFAndGIncomplete: <function> = fn_decl @CallFAndGIncomplete [template] {}
-// CHECK:STDOUT:   %import_ref.8 = import_ref ir1, inst+5, unloaded
+// CHECK:STDOUT:   %import_ref.8 = import_ref ir1, inst+4, unloaded
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @C;

+ 0 - 2
toolchain/check/testdata/function/declaration/fail_modifiers.carbon → toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon

@@ -98,7 +98,6 @@ extern private fn ExternOrderAndConflict() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .WrongOrder = %WrongOrder
 // CHECK:STDOUT:     .DuplicateVirtual = %DuplicateVirtual
 // CHECK:STDOUT:     .TwoAccess = %TwoAccess
@@ -107,7 +106,6 @@ extern private fn ExternOrderAndConflict() {}
 // CHECK:STDOUT:     .ModifiersConflict2 = %ModifiersConflict2
 // CHECK:STDOUT:     .ExternOrderAndConflict = %ExternOrderAndConflict
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %WrongOrder: <function> = fn_decl @WrongOrder [template] {}
 // CHECK:STDOUT:   %DuplicateVirtual: <function> = fn_decl @DuplicateVirtual [template] {}
 // CHECK:STDOUT:   %TwoAccess: <function> = fn_decl @TwoAccess [template] {}

+ 28 - 20
toolchain/check/testdata/function/declaration/fail_redecl.carbon → toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon

@@ -14,25 +14,25 @@ fn A();
 // CHECK:STDERR:
 fn A();
 
-fn B(x: i32);
+fn B(x: ());
 // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn B` is redundant.
-// CHECK:STDERR: fn B(x: i32);
-// CHECK:STDERR: ^~~~~~~~~~~~~
+// CHECK:STDERR: fn B(x: ());
+// CHECK:STDERR: ^~~~~~~~~~~~
 // CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously declared here.
-// CHECK:STDERR: fn B(x: i32);
-// CHECK:STDERR: ^~~~~~~~~~~~~
+// CHECK:STDERR: fn B(x: ());
+// CHECK:STDERR: ^~~~~~~~~~~~
 // CHECK:STDERR:
-fn B(x: i32);
+fn B(x: ());
 
 fn C();
 // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because of parameter count of 1.
-// CHECK:STDERR: fn C(x: i32);
-// CHECK:STDERR: ^~~~~~~~~~~~~
+// CHECK:STDERR: fn C(x: ());
+// CHECK:STDERR: ^~~~~~~~~~~~
 // CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously declared with parameter count of 0.
 // CHECK:STDERR: fn C();
 // CHECK:STDERR: ^~~~~~~
 // CHECK:STDERR:
-fn C(x: i32);
+fn C(x: ());
 
 fn D() {}
 // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn D` is redundant.
@@ -55,30 +55,38 @@ fn E() {}
 
 // CHECK:STDOUT: --- fail_redecl.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A.loc7
 // CHECK:STDOUT:     .B = %B.loc17
 // CHECK:STDOUT:     .C = %C
 // CHECK:STDOUT:     .D = %D.loc37
 // CHECK:STDOUT:     .E = %E.loc47
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A.loc7: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT:   %A.loc15: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT:   %B.loc17: <function> = fn_decl @B [template] {
-// CHECK:STDOUT:     %x.loc17_6.1: i32 = param x
-// CHECK:STDOUT:     @B.%x: i32 = bind_name x, %x.loc17_6.1
+// CHECK:STDOUT:     %.loc17_10.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc17_10.2: type = converted %.loc17_10.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %x.loc17_6.1: () = param x
+// CHECK:STDOUT:     @B.%x: () = bind_name x, %x.loc17_6.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %B.loc25: <function> = fn_decl @B [template] {
-// CHECK:STDOUT:     %x.loc25_6.1: i32 = param x
-// CHECK:STDOUT:     %x.loc25_6.2: i32 = bind_name x, %x.loc25_6.1
+// CHECK:STDOUT:     %.loc25_10.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc25_10.2: type = converted %.loc25_10.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %x.loc25_6.1: () = param x
+// CHECK:STDOUT:     %x.loc25_6.2: () = bind_name x, %x.loc25_6.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %C: <function> = fn_decl @C [template] {}
-// CHECK:STDOUT:   %.loc35: <function> = fn_decl @.1 [template] {
-// CHECK:STDOUT:     %x.loc35_6.1: i32 = param x
-// CHECK:STDOUT:     @.1.%x: i32 = bind_name x, %x.loc35_6.1
+// CHECK:STDOUT:   %.loc35_12: <function> = fn_decl @.1 [template] {
+// CHECK:STDOUT:     %.loc35_10.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc35_10.2: type = converted %.loc35_10.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %x.loc35_6.1: () = param x
+// CHECK:STDOUT:     @.1.%x: () = bind_name x, %x.loc35_6.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %D.loc37: <function> = fn_decl @D [template] {}
 // CHECK:STDOUT:   %D.loc45: <function> = fn_decl @D [template] {}
@@ -88,11 +96,11 @@ fn E() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @A();
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @B(%x: i32);
+// CHECK:STDOUT: fn @B(%x: ());
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @C();
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @.1(%x: i32);
+// CHECK:STDOUT: fn @.1(%x: ());
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @D() {
 // CHECK:STDOUT: !entry:

+ 0 - 2
toolchain/check/testdata/function/declaration/fail_todo_modifiers.carbon → toolchain/check/testdata/function/declaration/no_prelude/fail_todo_modifiers.carbon

@@ -13,10 +13,8 @@ private fn F();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 3 - 15
toolchain/check/testdata/function/declaration/implicit_import.carbon → toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon

@@ -63,10 +63,8 @@ extern fn A();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -76,11 +74,9 @@ extern fn A();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -90,10 +86,8 @@ extern fn A();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -103,11 +97,9 @@ extern fn A();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -117,10 +109,8 @@ extern fn A();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -130,11 +120,9 @@ extern fn A();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/function/declaration/simple.carbon → toolchain/check/testdata/function/declaration/no_prelude/simple.carbon

@@ -16,11 +16,9 @@ fn G() { F(); }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:     .G = %G
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %G: <function> = fn_decl @G [template] {}
 // CHECK:STDOUT: }

+ 0 - 8
toolchain/check/testdata/function/definition/extern.carbon → toolchain/check/testdata/function/definition/no_prelude/extern.carbon

@@ -60,10 +60,8 @@ extern fn F();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -76,10 +74,8 @@ extern fn F();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F.loc12
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F.loc4: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %F.loc12: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }
@@ -93,10 +89,8 @@ extern fn F();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F.loc12
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F.loc4: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %F.loc12: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %F.loc13: <function> = fn_decl @F [template] {}
@@ -111,10 +105,8 @@ extern fn F();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F.loc4
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F.loc4: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %F.loc11: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }

+ 69 - 51
toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon → toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon

@@ -6,73 +6,74 @@
 
 fn F();
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because of parameter count of 1.
-// CHECK:STDERR: fn F(x: i32) {}
-// CHECK:STDERR: ^~~~~~~~~~~~~~
+// CHECK:STDERR: fn F(x: ()) {}
+// CHECK:STDERR: ^~~~~~~~~~~~~
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with parameter count of 0.
 // CHECK:STDERR: fn F();
 // CHECK:STDERR: ^~~~~~~
 // CHECK:STDERR:
-fn F(x: i32) {}
+fn F(x: ()) {}
 
-fn G(x: i32);
+fn G(x: ());
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because of parameter count of 0.
 // CHECK:STDERR: fn G() {}
 // CHECK:STDERR: ^~~~~~~~
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with parameter count of 1.
-// CHECK:STDERR: fn G(x: i32);
-// CHECK:STDERR: ^~~~~~~~~~~~~
+// CHECK:STDERR: fn G(x: ());
+// CHECK:STDERR: ^~~~~~~~~~~~
 // CHECK:STDERR:
 fn G() {}
 
-fn H(x: i32);
+fn H(x: ());
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:6: ERROR: Function redeclaration differs at parameter 1.
 // CHECK:STDERR: fn H(x: bool) {}
 // CHECK:STDERR:      ^
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:6: Previous declaration's corresponding parameter here.
-// CHECK:STDERR: fn H(x: i32);
+// CHECK:STDERR: fn H(x: ());
 // CHECK:STDERR:      ^
 // CHECK:STDERR:
 fn H(x: bool) {}
 
 fn I();
-// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because return type is `i32`.
-// CHECK:STDERR: fn I() -> i32 { return 0; }
-// CHECK:STDERR: ^~~~~~~~~~~~~~~
+// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because return type is `()`.
+// CHECK:STDERR: fn I() -> () { return (); }
+// CHECK:STDERR: ^~~~~~~~~~~~~~
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with no return type.
 // CHECK:STDERR: fn I();
 // CHECK:STDERR: ^~~~~~~
 // CHECK:STDERR:
-fn I() -> i32 { return 0; }
+fn I() -> () { return (); }
 
-fn J() -> i32;
+fn J() -> ();
 // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because no return type is provided.
 // CHECK:STDERR: fn J() {}
 // CHECK:STDERR: ^~~~~~~~
-// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with return type `i32`.
-// CHECK:STDERR: fn J() -> i32;
-// CHECK:STDERR: ^~~~~~~~~~~~~~
+// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with return type `()`.
+// CHECK:STDERR: fn J() -> ();
+// CHECK:STDERR: ^~~~~~~~~~~~~
 // CHECK:STDERR:
 fn J() {}
 
-fn K() -> i32;
-// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: ERROR: Function redeclaration differs because return type is `bool`.
-// CHECK:STDERR: fn K() -> bool { return false; }
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~
-// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with return type `i32`.
-// CHECK:STDERR: fn K() -> i32;
+fn K() -> ();
+// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: ERROR: Function redeclaration differs because return type is `{}`.
+// CHECK:STDERR: fn K() -> {} { return {}; }
 // CHECK:STDERR: ^~~~~~~~~~~~~~
-fn K() -> bool { return false; }
+// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with return type `()`.
+// CHECK:STDERR: fn K() -> ();
+// CHECK:STDERR: ^~~~~~~~~~~~~
+fn K() -> {} { return {}; }
 
 // CHECK:STDOUT: --- fail_decl_param_mismatch.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.2: bool = bool_literal false [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT:   %.3: type = struct_type {} [template]
+// CHECK:STDOUT:   %.4: {} = struct_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:     .G = %G
 // CHECK:STDOUT:     .H = %H
@@ -80,56 +81,69 @@ fn K() -> bool { return false; }
 // CHECK:STDOUT:     .J = %J
 // CHECK:STDOUT:     .K = %K
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {}
-// CHECK:STDOUT:   %.loc15: <function> = fn_decl @.1 [template] {
-// CHECK:STDOUT:     %x.loc15_6.1: i32 = param x
-// CHECK:STDOUT:     @.1.%x: i32 = bind_name x, %x.loc15_6.1
+// CHECK:STDOUT:   %.loc15_13: <function> = fn_decl @.1 [template] {
+// CHECK:STDOUT:     %.loc15_10.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc15_10.2: type = converted %.loc15_10.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %x.loc15_6.1: () = param x
+// CHECK:STDOUT:     @.1.%x: () = bind_name x, %x.loc15_6.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %G: <function> = fn_decl @G [template] {
-// CHECK:STDOUT:     %x.loc17_6.1: i32 = param x
-// CHECK:STDOUT:     @G.%x: i32 = bind_name x, %x.loc17_6.1
+// CHECK:STDOUT:     %.loc17_10.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc17_10.2: type = converted %.loc17_10.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %x.loc17_6.1: () = param x
+// CHECK:STDOUT:     @G.%x: () = bind_name x, %x.loc17_6.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %.loc25: <function> = fn_decl @.2 [template] {}
 // CHECK:STDOUT:   %H: <function> = fn_decl @H [template] {
-// CHECK:STDOUT:     %x.loc27_6.1: i32 = param x
-// CHECK:STDOUT:     @H.%x: i32 = bind_name x, %x.loc27_6.1
+// CHECK:STDOUT:     %.loc27_10.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc27_10.2: type = converted %.loc27_10.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %x.loc27_6.1: () = param x
+// CHECK:STDOUT:     @H.%x: () = bind_name x, %x.loc27_6.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %.loc35: <function> = fn_decl @.3 [template] {
 // CHECK:STDOUT:     %x.loc35_6.1: bool = param x
 // CHECK:STDOUT:     @.3.%x: bool = bind_name x, %x.loc35_6.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %I: <function> = fn_decl @I [template] {}
-// CHECK:STDOUT:   %.loc45: <function> = fn_decl @.4 [template] {
-// CHECK:STDOUT:     @.4.%return: ref i32 = var <return slot>
+// CHECK:STDOUT:   %.loc45_14: <function> = fn_decl @.4 [template] {
+// CHECK:STDOUT:     %.loc45_12.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc45_12.2: type = converted %.loc45_12.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     @.4.%return: ref () = var <return slot>
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %J: <function> = fn_decl @J [template] {
-// CHECK:STDOUT:     @J.%return: ref i32 = var <return slot>
+// CHECK:STDOUT:     %.loc47_12.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc47_12.2: type = converted %.loc47_12.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     @J.%return: ref () = var <return slot>
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %.loc55: <function> = fn_decl @.5 [template] {}
 // CHECK:STDOUT:   %K: <function> = fn_decl @K [template] {
-// CHECK:STDOUT:     @K.%return: ref i32 = var <return slot>
+// CHECK:STDOUT:     %.loc57_12.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc57_12.2: type = converted %.loc57_12.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     @K.%return: ref () = var <return slot>
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc64: <function> = fn_decl @.6 [template] {
-// CHECK:STDOUT:     @.6.%return: ref bool = var <return slot>
+// CHECK:STDOUT:   %.loc64_14: <function> = fn_decl @.6 [template] {
+// CHECK:STDOUT:     %.loc64_12.1: {} = struct_literal ()
+// CHECK:STDOUT:     %.loc64_12.2: type = converted %.loc64_12.1, constants.%.3 [template = constants.%.3]
+// CHECK:STDOUT:     @.6.%return: ref {} = var <return slot>
 // CHECK:STDOUT:   }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F();
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @.1(%x: i32) {
+// CHECK:STDOUT: fn @.1(%x: ()) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @G(%x: i32);
+// CHECK:STDOUT: fn @G(%x: ());
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @.2() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @H(%x: i32);
+// CHECK:STDOUT: fn @H(%x: ());
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @.3(%x: bool) {
 // CHECK:STDOUT: !entry:
@@ -138,24 +152,28 @@ fn K() -> bool { return false; }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @I();
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @.4() -> i32 {
+// CHECK:STDOUT: fn @.4() -> () {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc45: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   return %.loc45
+// CHECK:STDOUT:   %.loc45_24.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc45_24.2: () = tuple_value () [template = constants.%.2]
+// CHECK:STDOUT:   %.loc45_25: () = converted %.loc45_24.1, %.loc45_24.2 [template = constants.%.2]
+// CHECK:STDOUT:   return %.loc45_25
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @J() -> i32;
+// CHECK:STDOUT: fn @J() -> ();
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @.5() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @K() -> i32;
+// CHECK:STDOUT: fn @K() -> ();
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @.6() -> bool {
+// CHECK:STDOUT: fn @.6() -> {} {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc64: bool = bool_literal false [template = constants.%.2]
-// CHECK:STDOUT:   return %.loc64
+// CHECK:STDOUT:   %.loc64_24.1: {} = struct_literal ()
+// CHECK:STDOUT:   %.loc64_24.2: {} = struct_value () [template = constants.%.4]
+// CHECK:STDOUT:   %.loc64_25: {} = converted %.loc64_24.1, %.loc64_24.2 [template = constants.%.4]
+// CHECK:STDOUT:   return %.loc64_25
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/function/definition/fail_redef.carbon → toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon

@@ -17,10 +17,8 @@ fn F() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F.loc7
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F.loc7: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT:   %F.loc14: <function> = fn_decl @F [template] {}
 // CHECK:STDOUT: }

+ 0 - 2
toolchain/check/testdata/function/definition/forward_decl.carbon → toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon

@@ -12,10 +12,8 @@ fn Foo() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Foo = %Foo.loc7
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Foo.loc7: <function> = fn_decl @Foo [template] {}
 // CHECK:STDOUT:   %Foo.loc9: <function> = fn_decl @Foo [template] {}
 // CHECK:STDOUT: }

+ 5 - 25
toolchain/check/testdata/function/definition/implicit_import.carbon → toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon

@@ -101,10 +101,8 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -114,11 +112,9 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -131,10 +127,8 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -144,11 +138,9 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -161,10 +153,8 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -174,11 +164,9 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -191,10 +179,8 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -207,11 +193,9 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -221,10 +205,8 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -237,11 +219,9 @@ fn A() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
 // CHECK:STDOUT:   %A: <function> = fn_decl @A [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/function/definition/order.carbon → toolchain/check/testdata/function/definition/no_prelude/order.carbon

@@ -12,12 +12,10 @@ fn Baz() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Foo = %Foo
 // CHECK:STDOUT:     .Bar = %Bar
 // CHECK:STDOUT:     .Baz = %Baz
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Foo: <function> = fn_decl @Foo [template] {}
 // CHECK:STDOUT:   %Bar: <function> = fn_decl @Bar [template] {}
 // CHECK:STDOUT:   %Baz: <function> = fn_decl @Baz [template] {}

+ 0 - 2
toolchain/check/testdata/function/definition/params_zero.carbon → toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon

@@ -10,10 +10,8 @@ fn Foo() {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Foo = %Foo
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Foo: <function> = fn_decl @Foo [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon → toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon

@@ -22,10 +22,8 @@ fn F(T:! type, U:! type) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
 // CHECK:STDOUT:     %T.loc7_6.1: type = param T
 // CHECK:STDOUT:     @F.%T: type = bind_symbolic_name T 0, %T.loc7_6.1 [symbolic = constants.%T]

+ 0 - 2
toolchain/check/testdata/function/generic/type_param.carbon → toolchain/check/testdata/function/generic/no_prelude/type_param.carbon

@@ -18,10 +18,8 @@ fn F(T:! type) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
 // CHECK:STDOUT:     %T.loc7_6.1: type = param T
 // CHECK:STDOUT:     @F.%T: type = bind_symbolic_name T 0, %T.loc7_6.1 [symbolic = constants.%T]

+ 0 - 2
toolchain/check/testdata/function/generic/type_param_scope.carbon → toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon

@@ -17,10 +17,8 @@ fn F(T:! type, n: T) -> T {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
 // CHECK:STDOUT:     %T.loc7_6.1: type = param T
 // CHECK:STDOUT:     @F.%T: type = bind_symbolic_name T 0, %T.loc7_6.1 [symbolic = constants.%T]

+ 150 - 0
toolchain/check/testdata/impl/lookup/no_prelude/import.carbon

@@ -0,0 +1,150 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+// --- impl.carbon
+
+package Impl api;
+
+interface HasF {
+  fn F();
+}
+
+class C {}
+
+impl C as HasF {
+  fn F() {}
+}
+
+// --- use.carbon
+
+import Impl;
+
+fn G(c: Impl.C) {
+  c.(Impl.HasF.F)();
+}
+
+// CHECK:STDOUT: --- impl.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = interface_type @HasF [template]
+// CHECK:STDOUT:   %Self: HasF = bind_symbolic_name Self 0 [symbolic]
+// CHECK:STDOUT:   %.2: type = assoc_entity_type @HasF, <function> [template]
+// CHECK:STDOUT:   %.3: <associated <function> in HasF> = assoc_entity element0, @HasF.%F [template]
+// CHECK:STDOUT:   %C: type = class_type @C [template]
+// CHECK:STDOUT:   %.4: type = struct_type {} [template]
+// CHECK:STDOUT:   %.5: <witness> = interface_witness (@impl.%F) [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .HasF = %HasF.decl
+// CHECK:STDOUT:     .C = %C.decl
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {}
+// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
+// CHECK:STDOUT:   impl_decl @impl {
+// CHECK:STDOUT:     %C.ref: type = name_ref C, %C.decl [template = constants.%C]
+// CHECK:STDOUT:     %HasF.ref: type = name_ref HasF, %HasF.decl [template = constants.%.1]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: interface @HasF {
+// CHECK:STDOUT:   %Self: HasF = bind_symbolic_name Self 0 [symbolic = constants.%Self]
+// CHECK:STDOUT:   %F: <function> = fn_decl @F.1 [template] {}
+// CHECK:STDOUT:   %.loc5: <associated <function> in HasF> = assoc_entity element0, %F [template = constants.%.3]
+// CHECK:STDOUT:
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = %Self
+// CHECK:STDOUT:   .F = %.loc5
+// CHECK:STDOUT:   witness = (%F)
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: impl @impl: C as HasF {
+// CHECK:STDOUT:   %F: <function> = fn_decl @F.2 [template] {}
+// CHECK:STDOUT:   %.1: <witness> = interface_witness (%F) [template = constants.%.5]
+// CHECK:STDOUT:
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .F = %F
+// CHECK:STDOUT:   witness = %.1
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: class @C {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = constants.%C
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F.1();
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F.2() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: --- use.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %C: type = class_type @C [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = interface_type @HasF [template]
+// CHECK:STDOUT:   %Self: HasF = bind_symbolic_name Self 0 [symbolic]
+// CHECK:STDOUT:   %.3: type = tuple_type () [template]
+// CHECK:STDOUT:   %.4: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.5: type = assoc_entity_type @HasF, <function> [template]
+// CHECK:STDOUT:   %.6: <associated <function> in HasF> = assoc_entity element0, file.%import_ref.8 [template]
+// CHECK:STDOUT:   %.7: <witness> = interface_witness (<unexpected instref inst+32>) [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .Impl = %Impl
+// CHECK:STDOUT:     .G = %G
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %Impl: <namespace> = namespace [template] {}
+// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
+// CHECK:STDOUT:   %import_ref.1 = import_ref ir1, inst+10, unloaded
+// CHECK:STDOUT:   %HasF.decl: type = interface_decl @HasF [template = constants.%.2] {}
+// CHECK:STDOUT:   %import_ref.2: <associated <function> in HasF> = import_ref ir1, inst+7, loc_20 [template = constants.%.6]
+// CHECK:STDOUT:   %import_ref.3 = import_ref ir1, inst+3, unloaded
+// CHECK:STDOUT:   %import_ref.4 = import_ref ir1, inst+5, unloaded
+// CHECK:STDOUT:   %import_ref.5: <witness> = import_ref ir1, inst+16, loc_22 [template = constants.%.7]
+// CHECK:STDOUT:   %import_ref.6: type = import_ref ir1, inst+9, loc_10 [template = constants.%C]
+// CHECK:STDOUT:   %G: <function> = fn_decl @G [template] {
+// CHECK:STDOUT:     %Impl.ref: <namespace> = name_ref Impl, %Impl [template = %Impl]
+// CHECK:STDOUT:     %C.ref: type = name_ref C, %import_ref.6 [template = constants.%C]
+// CHECK:STDOUT:     %c.loc4_6.1: C = param c
+// CHECK:STDOUT:     @G.%c: C = bind_name c, %c.loc4_6.1
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %import_ref.7: type = import_ref ir1, inst+1, loc_18 [template = constants.%.2]
+// CHECK:STDOUT:   %import_ref.8 = import_ref ir1, inst+5, unloaded
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: interface @HasF {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .F = file.%import_ref.2
+// CHECK:STDOUT:   .Self = file.%import_ref.3
+// CHECK:STDOUT:   witness = (file.%import_ref.4)
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: impl @impl: C as HasF;
+// CHECK:STDOUT:
+// CHECK:STDOUT: class @C {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = file.%import_ref.1
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @G(%c: C) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %c.ref: C = name_ref c, %c
+// CHECK:STDOUT:   %Impl.ref: <namespace> = name_ref Impl, file.%Impl [template = file.%Impl]
+// CHECK:STDOUT:   %HasF.ref: type = name_ref HasF, file.%import_ref.7 [template = constants.%.2]
+// CHECK:STDOUT:   %F.ref: <associated <function> in HasF> = name_ref F, file.%import_ref.2 [template = constants.%.6]
+// CHECK:STDOUT:   %.1: <function> = interface_witness_access file.%import_ref.5, element0 [template = <unexpected instref inst+32>]
+// CHECK:STDOUT:   %F.call: init () = call %.1()
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F();
+// CHECK:STDOUT:

+ 16 - 6
toolchain/check/testdata/impl/basic.carbon → toolchain/check/testdata/impl/no_prelude/basic.carbon

@@ -8,7 +8,9 @@ interface Simple {
   fn F();
 }
 
-impl i32 as Simple {
+class C {}
+
+impl C as Simple {
   fn F() {}
 }
 
@@ -19,17 +21,20 @@ impl i32 as Simple {
 // CHECK:STDOUT:   %Self: Simple = bind_symbolic_name Self 0 [symbolic]
 // CHECK:STDOUT:   %.2: type = assoc_entity_type @Simple, <function> [template]
 // CHECK:STDOUT:   %.3: <associated <function> in Simple> = assoc_entity element0, @Simple.%F [template]
-// CHECK:STDOUT:   %.4: <witness> = interface_witness (@impl.%F) [template]
+// CHECK:STDOUT:   %C: type = class_type @C [template]
+// CHECK:STDOUT:   %.4: type = struct_type {} [template]
+// CHECK:STDOUT:   %.5: <witness> = interface_witness (@impl.%F) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Simple = %Simple.decl
+// CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {}
+// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   impl_decl @impl {
+// CHECK:STDOUT:     %C.ref: type = name_ref C, %C.decl [template = constants.%C]
 // CHECK:STDOUT:     %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT: }
@@ -45,15 +50,20 @@ impl i32 as Simple {
 // CHECK:STDOUT:   witness = (%F)
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: impl @impl: i32 as Simple {
+// CHECK:STDOUT: impl @impl: C as Simple {
 // CHECK:STDOUT:   %F: <function> = fn_decl @F.2 [template] {}
-// CHECK:STDOUT:   %.1: <witness> = interface_witness (%F) [template = constants.%.4]
+// CHECK:STDOUT:   %.1: <witness> = interface_witness (%F) [template = constants.%.5]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .F = %F
 // CHECK:STDOUT:   witness = %.1
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
+// CHECK:STDOUT: class @C {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = constants.%C
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: fn @F.1();
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F.2() {

+ 166 - 0
toolchain/check/testdata/impl/no_prelude/import_self.carbon

@@ -0,0 +1,166 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+// --- a.carbon
+
+library "a" api;
+
+interface Add {
+  fn Op[self: Self](other: Self) -> Self;
+}
+
+// --- b.carbon
+
+library "b" api;
+
+import library "a";
+
+impl () as Add {
+  fn Op[self: Self](other: Self) -> Self { return (); }
+}
+
+fn F(x: (), y: ()) -> () {
+  return x.(Add.Op)(y);
+}
+
+// CHECK:STDOUT: --- a.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = interface_type @Add [template]
+// CHECK:STDOUT:   %Self: Add = bind_symbolic_name Self 0 [symbolic]
+// CHECK:STDOUT:   %.2: type = assoc_entity_type @Add, <function> [template]
+// CHECK:STDOUT:   %.3: <associated <function> in Add> = assoc_entity element0, @Add.%Op [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .Add = %Add.decl
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %Add.decl: type = interface_decl @Add [template = constants.%.1] {}
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: interface @Add {
+// CHECK:STDOUT:   %Self: Add = bind_symbolic_name Self 0 [symbolic = constants.%Self]
+// CHECK:STDOUT:   %Op: <function> = fn_decl @Op [template] {
+// CHECK:STDOUT:     %Self.ref.loc5_15: Add = name_ref Self, %Self [symbolic = constants.%Self]
+// CHECK:STDOUT:     %.loc5_15.1: type = facet_type_access %Self.ref.loc5_15 [symbolic = constants.%Self]
+// CHECK:STDOUT:     %.loc5_15.2: type = converted %Self.ref.loc5_15, %.loc5_15.1 [symbolic = constants.%Self]
+// CHECK:STDOUT:     %self.loc5_9.1: Self = param self
+// CHECK:STDOUT:     %self.loc5_9.2: Self = bind_name self, %self.loc5_9.1
+// CHECK:STDOUT:     %Self.ref.loc5_28: Add = name_ref Self, %Self [symbolic = constants.%Self]
+// CHECK:STDOUT:     %.loc5_28.1: type = facet_type_access %Self.ref.loc5_28 [symbolic = constants.%Self]
+// CHECK:STDOUT:     %.loc5_28.2: type = converted %Self.ref.loc5_28, %.loc5_28.1 [symbolic = constants.%Self]
+// CHECK:STDOUT:     %other.loc5_21.1: Self = param other
+// CHECK:STDOUT:     %other.loc5_21.2: Self = bind_name other, %other.loc5_21.1
+// CHECK:STDOUT:     %Self.ref.loc5_37: Add = name_ref Self, %Self [symbolic = constants.%Self]
+// CHECK:STDOUT:     %.loc5_37.1: type = facet_type_access %Self.ref.loc5_37 [symbolic = constants.%Self]
+// CHECK:STDOUT:     %.loc5_37.2: type = converted %Self.ref.loc5_37, %.loc5_37.1 [symbolic = constants.%Self]
+// CHECK:STDOUT:     %return.var: ref Self = var <return slot>
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc5_41: <associated <function> in Add> = assoc_entity element0, %Op [template = constants.%.3]
+// CHECK:STDOUT:
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = %Self
+// CHECK:STDOUT:   .Op = %.loc5_41
+// CHECK:STDOUT:   witness = (%Op)
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Op[@Add.%self.loc5_9.2: Self](@Add.%other.loc5_21.2: Self) -> Self;
+// CHECK:STDOUT:
+// CHECK:STDOUT: --- b.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = interface_type @Add [template]
+// CHECK:STDOUT:   %Self: Add = bind_symbolic_name Self 0 [symbolic]
+// CHECK:STDOUT:   %.3: <witness> = interface_witness (@impl.%Op) [template]
+// CHECK:STDOUT:   %.4: () = tuple_value () [template]
+// CHECK:STDOUT:   %.5: type = assoc_entity_type @Add, <function> [template]
+// CHECK:STDOUT:   %.6: <associated <function> in Add> = assoc_entity element0, file.%import_ref.5 [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .Add = %import_ref.1
+// CHECK:STDOUT:     .F = %F
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %import_ref.1: type = import_ref ir1, inst+1, loc_13 [template = constants.%.2]
+// CHECK:STDOUT:   %import_ref.2: <associated <function> in Add> = import_ref ir1, inst+21, loc_58 [template = constants.%.6]
+// CHECK:STDOUT:   %import_ref.3 = import_ref ir1, inst+3, unloaded
+// CHECK:STDOUT:   %import_ref.4: <function> = import_ref ir1, inst+19, loc_14 [template = imports.%Op]
+// CHECK:STDOUT:   impl_decl @impl {
+// CHECK:STDOUT:     %.loc6_7.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc6_7.2: type = converted %.loc6_7.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %Add.decl: type = interface_decl @Add [template = constants.%.2] {}
+// CHECK:STDOUT:     %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
+// CHECK:STDOUT:     %.loc10_10.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc10_10.2: type = converted %.loc10_10.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %x.loc10_6.1: () = param x
+// CHECK:STDOUT:     @F.%x: () = bind_name x, %x.loc10_6.1
+// CHECK:STDOUT:     %.loc10_17.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc10_17.2: type = converted %.loc10_17.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %y.loc10_13.1: () = param y
+// CHECK:STDOUT:     @F.%y: () = bind_name y, %y.loc10_13.1
+// CHECK:STDOUT:     %.loc10_24.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc10_24.2: type = converted %.loc10_24.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     @F.%return: ref () = var <return slot>
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %import_ref.5 = import_ref ir1, inst+19, unloaded
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: interface @Add {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Op = file.%import_ref.2
+// CHECK:STDOUT:   .Self = file.%import_ref.3
+// CHECK:STDOUT:   witness = (file.%import_ref.4)
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: impl @impl: () as Add {
+// CHECK:STDOUT:   %Op: <function> = fn_decl @Op.1 [template] {
+// CHECK:STDOUT:     %Self.ref.loc7_15: type = name_ref Self, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %self.loc7_9.1: () = param self
+// CHECK:STDOUT:     %self.loc7_9.2: () = bind_name self, %self.loc7_9.1
+// CHECK:STDOUT:     %Self.ref.loc7_28: type = name_ref Self, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %other.loc7_21.1: () = param other
+// CHECK:STDOUT:     %other.loc7_21.2: () = bind_name other, %other.loc7_21.1
+// CHECK:STDOUT:     %Self.ref.loc7_37: type = name_ref Self, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:     %return.var: ref () = var <return slot>
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.1: <witness> = interface_witness (%Op) [template = constants.%.3]
+// CHECK:STDOUT:
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Op = %Op
+// CHECK:STDOUT:   witness = %.1
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Op.1[@impl.%self.loc7_9.2: ()](@impl.%other.loc7_21.2: ()) -> () {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc7_52.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_52.2: () = tuple_value () [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_53: () = converted %.loc7_52.1, %.loc7_52.2 [template = constants.%.4]
+// CHECK:STDOUT:   return %.loc7_53
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Op.2[%self: Self](%other: Self) -> Self;
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F(%x: (), %y: ()) -> () {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %x.ref: () = name_ref x, %x
+// CHECK:STDOUT:   %Add.ref: type = name_ref Add, file.%import_ref.1 [template = constants.%.2]
+// CHECK:STDOUT:   %Op.ref: <associated <function> in Add> = name_ref Op, file.%import_ref.2 [template = constants.%.6]
+// CHECK:STDOUT:   %.1: <function> = interface_witness_access @impl.%.1, element0 [template = @impl.%Op]
+// CHECK:STDOUT:   %.loc11_11: <bound method> = bound_method %x.ref, %.1
+// CHECK:STDOUT:   %y.ref: () = name_ref y, %y
+// CHECK:STDOUT:   %.loc11_20.1: init () = call %.loc11_11(%x.ref, %y.ref)
+// CHECK:STDOUT:   %.loc11_20.2: ref () = temporary_storage
+// CHECK:STDOUT:   %.loc11_20.3: ref () = temporary %.loc11_20.2, %.loc11_20.1
+// CHECK:STDOUT:   %.loc11_20.4: () = tuple_value () [template = constants.%.4]
+// CHECK:STDOUT:   %.loc11_23: () = converted %.loc11_20.1, %.loc11_20.4 [template = constants.%.4]
+// CHECK:STDOUT:   return %.loc11_23
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 14
toolchain/check/testdata/impl/self_in_class.carbon → toolchain/check/testdata/impl/no_prelude/self_in_class.carbon

@@ -8,11 +8,13 @@ interface DefaultConstructible {
   fn Make() -> Self;
 }
 
+class C {}
+
 class A {
-  impl i32 as DefaultConstructible {
+  impl C as DefaultConstructible {
     // `Self` here refers to `i32`, not `A`.
     // TODO: Revisit this once #3714 is resolved.
-    fn Make() -> Self { return 0; }
+    fn Make() -> Self { return {}; }
   }
 }
 
@@ -23,20 +25,23 @@ class A {
 // CHECK:STDOUT:   %Self: DefaultConstructible = bind_symbolic_name Self 0 [symbolic]
 // CHECK:STDOUT:   %.2: type = assoc_entity_type @DefaultConstructible, <function> [template]
 // CHECK:STDOUT:   %.3: <associated <function> in DefaultConstructible> = assoc_entity element0, @DefaultConstructible.%Make [template]
+// CHECK:STDOUT:   %C: type = class_type @C [template]
+// CHECK:STDOUT:   %.4: type = struct_type {} [template]
 // CHECK:STDOUT:   %A: type = class_type @A [template]
-// CHECK:STDOUT:   %.4: <witness> = interface_witness (@impl.%Make) [template]
-// CHECK:STDOUT:   %.5: type = struct_type {} [template]
-// CHECK:STDOUT:   %.6: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.5: <witness> = interface_witness (@impl.%Make) [template]
+// CHECK:STDOUT:   %.6: type = tuple_type () [template]
+// CHECK:STDOUT:   %.7: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.8: C = struct_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .DefaultConstructible = %DefaultConstructible.decl
+// CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .A = %A.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %DefaultConstructible.decl: type = interface_decl @DefaultConstructible [template = constants.%.1] {}
+// CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %A.decl: type = class_decl @A [template = constants.%A] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -56,20 +61,26 @@ class A {
 // CHECK:STDOUT:   witness = (%Make)
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: impl @impl: i32 as DefaultConstructible {
+// CHECK:STDOUT: impl @impl: C as DefaultConstructible {
 // CHECK:STDOUT:   %Make: <function> = fn_decl @Make.2 [template] {
-// CHECK:STDOUT:     %Self.ref: type = name_ref Self, i32 [template = i32]
-// CHECK:STDOUT:     %return.var: ref i32 = var <return slot>
+// CHECK:STDOUT:     %Self.ref: type = name_ref Self, constants.%C [template = constants.%C]
+// CHECK:STDOUT:     %return.var: ref C = var <return slot>
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.1: <witness> = interface_witness (%Make) [template = constants.%.4]
+// CHECK:STDOUT:   %.1: <witness> = interface_witness (%Make) [template = constants.%.5]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .Make = %Make
 // CHECK:STDOUT:   witness = %.1
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
+// CHECK:STDOUT: class @C {
+// CHECK:STDOUT: !members:
+// CHECK:STDOUT:   .Self = constants.%C
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: class @A {
 // CHECK:STDOUT:   impl_decl @impl {
+// CHECK:STDOUT:     %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
 // CHECK:STDOUT:     %DefaultConstructible.ref: type = name_ref DefaultConstructible, file.%DefaultConstructible.decl [template = constants.%.1]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:
@@ -79,9 +90,11 @@ class A {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Make.1() -> Self;
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @Make.2() -> i32 {
+// CHECK:STDOUT: fn @Make.2() -> @impl.%return.var: C {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc15: i32 = int_literal 0 [template = constants.%.6]
-// CHECK:STDOUT:   return %.loc15
+// CHECK:STDOUT:   %.loc17_33.1: {} = struct_literal ()
+// CHECK:STDOUT:   %.loc17_33.2: init C = class_init (), @impl.%return.var [template = constants.%.8]
+// CHECK:STDOUT:   %.loc17_34: init C = converted %.loc17_33.1, %.loc17_33.2 [template = constants.%.8]
+// CHECK:STDOUT:   return %.loc17_34 to @impl.%return.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 35 - 31
toolchain/check/testdata/impl/self_in_signature.carbon → toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon

@@ -21,15 +21,15 @@ impl D as UseSelf {
 }
 
 interface SelfNested {
-  fn F(x: (Self*, {.x: Self, .y: i32}));
+  fn F(x: (Self*, {.x: Self, .y: ()}));
 }
 
 impl C as SelfNested {
-  fn F(x: (C*, {.x: C, .y: i32}));
+  fn F(x: (C*, {.x: C, .y: ()}));
 }
 
 impl D as SelfNested {
-  fn F(x: (Self*, {.x: Self, .y: i32}));
+  fn F(x: (Self*, {.x: Self, .y: ()}));
 }
 
 // CHECK:STDOUT: --- self_in_signature.carbon
@@ -51,30 +51,28 @@ impl D as SelfNested {
 // CHECK:STDOUT:   %.11: type = interface_type @SelfNested [template]
 // CHECK:STDOUT:   %Self.2: SelfNested = bind_symbolic_name Self 0 [symbolic]
 // CHECK:STDOUT:   %.12: type = ptr_type Self [symbolic]
-// CHECK:STDOUT:   %.13: type = struct_type {.x: Self, .y: i32} [symbolic]
+// CHECK:STDOUT:   %.13: type = struct_type {.x: Self, .y: ()} [symbolic]
 // CHECK:STDOUT:   %.14: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.15: type = tuple_type (Self*, {.x: Self, .y: i32}) [symbolic]
+// CHECK:STDOUT:   %.15: type = tuple_type (Self*, {.x: Self, .y: ()}) [symbolic]
 // CHECK:STDOUT:   %.16: type = assoc_entity_type @SelfNested, <function> [template]
 // CHECK:STDOUT:   %.17: <associated <function> in SelfNested> = assoc_entity element0, @SelfNested.%F [template]
 // CHECK:STDOUT:   %.18: type = ptr_type C [template]
-// CHECK:STDOUT:   %.19: type = struct_type {.x: C, .y: i32} [template]
-// CHECK:STDOUT:   %.20: type = tuple_type (C*, {.x: C, .y: i32}) [template]
+// CHECK:STDOUT:   %.19: type = struct_type {.x: C, .y: ()} [template]
+// CHECK:STDOUT:   %.20: type = tuple_type (C*, {.x: C, .y: ()}) [template]
 // CHECK:STDOUT:   %.21: <witness> = interface_witness (@impl.3.%F) [template]
 // CHECK:STDOUT:   %.22: type = ptr_type D [template]
-// CHECK:STDOUT:   %.23: type = struct_type {.x: D, .y: i32} [template]
-// CHECK:STDOUT:   %.24: type = tuple_type (D*, {.x: D, .y: i32}) [template]
+// CHECK:STDOUT:   %.23: type = struct_type {.x: D, .y: ()} [template]
+// CHECK:STDOUT:   %.24: type = tuple_type (D*, {.x: D, .y: ()}) [template]
 // CHECK:STDOUT:   %.25: <witness> = interface_witness (@impl.4.%F) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .UseSelf = %UseSelf.decl
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:     .D = %D.decl
 // CHECK:STDOUT:     .SelfNested = %SelfNested.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT:   %D.decl: type = class_decl @D [template = constants.%D] {}
@@ -133,17 +131,19 @@ impl D as SelfNested {
 // CHECK:STDOUT:     %Self.ref.loc24_24: SelfNested = name_ref Self, %Self [symbolic = constants.%Self.2]
 // CHECK:STDOUT:     %.loc24_24.1: type = facet_type_access %Self.ref.loc24_24 [symbolic = constants.%Self.2]
 // CHECK:STDOUT:     %.loc24_24.2: type = converted %Self.ref.loc24_24, %.loc24_24.1 [symbolic = constants.%Self.2]
-// CHECK:STDOUT:     %.loc24_37: type = struct_type {.x: Self, .y: i32} [symbolic = constants.%.13]
-// CHECK:STDOUT:     %.loc24_38.1: (type, type) = tuple_literal (%.loc24_16.3, %.loc24_37)
-// CHECK:STDOUT:     %.loc24_38.2: type = converted %.loc24_38.1, constants.%.15 [symbolic = constants.%.15]
-// CHECK:STDOUT:     %x.loc24_8.1: (Self*, {.x: Self, .y: i32}) = param x
-// CHECK:STDOUT:     %x.loc24_8.2: (Self*, {.x: Self, .y: i32}) = bind_name x, %x.loc24_8.1
+// CHECK:STDOUT:     %.loc24_35.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc24_35.2: type = converted %.loc24_35.1, constants.%.6 [template = constants.%.6]
+// CHECK:STDOUT:     %.loc24_36: type = struct_type {.x: Self, .y: ()} [symbolic = constants.%.13]
+// CHECK:STDOUT:     %.loc24_37.1: (type, type) = tuple_literal (%.loc24_16.3, %.loc24_36)
+// CHECK:STDOUT:     %.loc24_37.2: type = converted %.loc24_37.1, constants.%.15 [symbolic = constants.%.15]
+// CHECK:STDOUT:     %x.loc24_8.1: (Self*, {.x: Self, .y: ()}) = param x
+// CHECK:STDOUT:     %x.loc24_8.2: (Self*, {.x: Self, .y: ()}) = bind_name x, %x.loc24_8.1
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc24_40: <associated <function> in SelfNested> = assoc_entity element0, %F [template = constants.%.17]
+// CHECK:STDOUT:   %.loc24_39: <associated <function> in SelfNested> = assoc_entity element0, %F [template = constants.%.17]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .Self = %Self
-// CHECK:STDOUT:   .F = %.loc24_40
+// CHECK:STDOUT:   .F = %.loc24_39
 // CHECK:STDOUT:   witness = (%F)
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -188,11 +188,13 @@ impl D as SelfNested {
 // CHECK:STDOUT:     %C.ref.loc28_12: type = name_ref C, file.%C.decl [template = constants.%C]
 // CHECK:STDOUT:     %.loc28_13: type = ptr_type C [template = constants.%.18]
 // CHECK:STDOUT:     %C.ref.loc28_21: type = name_ref C, file.%C.decl [template = constants.%C]
-// CHECK:STDOUT:     %.loc28_31: type = struct_type {.x: C, .y: i32} [template = constants.%.19]
-// CHECK:STDOUT:     %.loc28_32.1: (type, type) = tuple_literal (%.loc28_13, %.loc28_31)
-// CHECK:STDOUT:     %.loc28_32.2: type = converted %.loc28_32.1, constants.%.20 [template = constants.%.20]
-// CHECK:STDOUT:     %x.loc28_8.1: (C*, {.x: C, .y: i32}) = param x
-// CHECK:STDOUT:     %x.loc28_8.2: (C*, {.x: C, .y: i32}) = bind_name x, %x.loc28_8.1
+// CHECK:STDOUT:     %.loc28_29.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc28_29.2: type = converted %.loc28_29.1, constants.%.6 [template = constants.%.6]
+// CHECK:STDOUT:     %.loc28_30: type = struct_type {.x: C, .y: ()} [template = constants.%.19]
+// CHECK:STDOUT:     %.loc28_31.1: (type, type) = tuple_literal (%.loc28_13, %.loc28_30)
+// CHECK:STDOUT:     %.loc28_31.2: type = converted %.loc28_31.1, constants.%.20 [template = constants.%.20]
+// CHECK:STDOUT:     %x.loc28_8.1: (C*, {.x: C, .y: ()}) = param x
+// CHECK:STDOUT:     %x.loc28_8.2: (C*, {.x: C, .y: ()}) = bind_name x, %x.loc28_8.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %.1: <witness> = interface_witness (%F) [template = constants.%.21]
 // CHECK:STDOUT:
@@ -206,11 +208,13 @@ impl D as SelfNested {
 // CHECK:STDOUT:     %Self.ref.loc32_12: type = name_ref Self, constants.%D [template = constants.%D]
 // CHECK:STDOUT:     %.loc32_16: type = ptr_type D [template = constants.%.22]
 // CHECK:STDOUT:     %Self.ref.loc32_24: type = name_ref Self, constants.%D [template = constants.%D]
-// CHECK:STDOUT:     %.loc32_37: type = struct_type {.x: D, .y: i32} [template = constants.%.23]
-// CHECK:STDOUT:     %.loc32_38.1: (type, type) = tuple_literal (%.loc32_16, %.loc32_37)
-// CHECK:STDOUT:     %.loc32_38.2: type = converted %.loc32_38.1, constants.%.24 [template = constants.%.24]
-// CHECK:STDOUT:     %x.loc32_8.1: (D*, {.x: D, .y: i32}) = param x
-// CHECK:STDOUT:     %x.loc32_8.2: (D*, {.x: D, .y: i32}) = bind_name x, %x.loc32_8.1
+// CHECK:STDOUT:     %.loc32_35.1: () = tuple_literal ()
+// CHECK:STDOUT:     %.loc32_35.2: type = converted %.loc32_35.1, constants.%.6 [template = constants.%.6]
+// CHECK:STDOUT:     %.loc32_36: type = struct_type {.x: D, .y: ()} [template = constants.%.23]
+// CHECK:STDOUT:     %.loc32_37.1: (type, type) = tuple_literal (%.loc32_16, %.loc32_36)
+// CHECK:STDOUT:     %.loc32_37.2: type = converted %.loc32_37.1, constants.%.24 [template = constants.%.24]
+// CHECK:STDOUT:     %x.loc32_8.1: (D*, {.x: D, .y: ()}) = param x
+// CHECK:STDOUT:     %x.loc32_8.2: (D*, {.x: D, .y: ()}) = bind_name x, %x.loc32_8.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %.1: <witness> = interface_witness (%F) [template = constants.%.25]
 // CHECK:STDOUT:
@@ -247,9 +251,9 @@ impl D as SelfNested {
 // CHECK:STDOUT:   return %.loc20_48 to @impl.2.%return.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @F.4(@SelfNested.%x.loc24_8.2: (Self*, {.x: Self, .y: i32}));
+// CHECK:STDOUT: fn @F.4(@SelfNested.%x.loc24_8.2: (Self*, {.x: Self, .y: ()}));
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @F.5(@impl.3.%x.loc28_8.2: (C*, {.x: C, .y: i32}));
+// CHECK:STDOUT: fn @F.5(@impl.3.%x.loc28_8.2: (C*, {.x: C, .y: ()}));
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @F.6(@impl.4.%x.loc32_8.2: (D*, {.x: D, .y: i32}));
+// CHECK:STDOUT: fn @F.6(@impl.4.%x.loc32_8.2: (D*, {.x: D, .y: ()}));
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/interface/as_type.carbon → toolchain/check/testdata/interface/no_prelude/as_type.carbon

@@ -18,11 +18,9 @@ fn F(e: Empty) {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Empty = %Empty.decl
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
 // CHECK:STDOUT:     %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1]

+ 0 - 2
toolchain/check/testdata/interface/as_type_of_type.carbon → toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon

@@ -21,11 +21,9 @@ fn F(T:! Empty) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Empty = %Empty.decl
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F [template] {
 // CHECK:STDOUT:     %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1]

+ 0 - 2
toolchain/check/testdata/interface/basic.carbon → toolchain/check/testdata/interface/no_prelude/basic.carbon

@@ -26,11 +26,9 @@ interface ForwardDeclared {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Empty = %Empty.decl
 // CHECK:STDOUT:     .ForwardDeclared = %ForwardDeclared.decl.loc10
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {}
 // CHECK:STDOUT:   %ForwardDeclared.decl.loc10: type = interface_decl @ForwardDeclared [template = constants.%.2] {}
 // CHECK:STDOUT:   %ForwardDeclared.decl.loc12: type = interface_decl @ForwardDeclared [template = constants.%.2] {}

+ 0 - 2
toolchain/check/testdata/interface/default_fn.carbon → toolchain/check/testdata/interface/no_prelude/default_fn.carbon

@@ -36,10 +36,8 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .C = %C.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %C.decl: type = class_decl @C [template = constants.%C] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon → toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon

@@ -40,11 +40,9 @@ interface Outer {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Interface = %Interface.decl
 // CHECK:STDOUT:     .Outer = %Outer.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F.1 [template] {}
 // CHECK:STDOUT:   %Outer.decl: type = interface_decl @Outer [template = constants.%.2] {}

+ 1 - 1
toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon → toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon

@@ -24,7 +24,7 @@ interface I {
 // CHECK:STDOUT:
 // CHECK:STDOUT: interface @I {
 // CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = <unexpected instref inst+4>
+// CHECK:STDOUT:   .Self = <unexpected instref inst+3>
 // CHECK:STDOUT:   witness = invalid
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon → toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon

@@ -26,12 +26,10 @@ alias UseOther = I.other;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .I = %I.decl
 // CHECK:STDOUT:     .UseA = %UseA
 // CHECK:STDOUT:     .UseOther = %UseOther
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %I.decl: type = interface_decl @I [template = constants.%.1] {}
 // CHECK:STDOUT:   %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1]
 // CHECK:STDOUT:   %a.ref: <error> = name_ref a, <error> [template = <error>]

+ 1 - 1
toolchain/check/testdata/interface/fail_assoc_const_template.carbon → toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon

@@ -22,7 +22,7 @@ interface I {
 // CHECK:STDOUT:
 // CHECK:STDOUT: interface @I {
 // CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = <unexpected instref inst+4>
+// CHECK:STDOUT:   .Self = <unexpected instref inst+3>
 // CHECK:STDOUT:   witness = invalid
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 3
toolchain/check/testdata/interface/fail_duplicate.carbon → toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon

@@ -51,12 +51,10 @@ interface Class { }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Interface = %Interface.decl.loc7
 // CHECK:STDOUT:     .Function = %Function
 // CHECK:STDOUT:     .Class = %Class.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Interface.decl.loc7: type = interface_decl @Interface [template = constants.%.1] {}
 // CHECK:STDOUT:   %Interface.decl.loc16: type = interface_decl @Interface [template = constants.%.1] {}
 // CHECK:STDOUT:   %Function: <function> = fn_decl @Function [template] {}
@@ -70,7 +68,7 @@ interface Class { }
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .F = <error>
-// CHECK:STDOUT:   .Self = <unexpected instref inst+4>
+// CHECK:STDOUT:   .Self = <unexpected instref inst+3>
 // CHECK:STDOUT:   witness = ()
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/interface/fail_lookup_undefined.carbon → toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon

@@ -57,12 +57,10 @@ interface BeingDefined {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Undefined = %Undefined.decl
 // CHECK:STDOUT:     .Test = %Test
 // CHECK:STDOUT:     .BeingDefined = %BeingDefined.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Undefined.decl: type = interface_decl @Undefined [template = constants.%.1] {}
 // CHECK:STDOUT:   %.loc16: <function> = fn_decl @.1 [template] {}
 // CHECK:STDOUT:   %Test: <function> = fn_decl @Test [template] {}

+ 0 - 2
toolchain/check/testdata/interface/fail_member_lookup.carbon → toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon

@@ -36,11 +36,9 @@ fn F() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Interface = %Interface.decl
 // CHECK:STDOUT:     .F = %F
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {}
 // CHECK:STDOUT:   %F: <function> = fn_decl @F.2 [template] {}
 // CHECK:STDOUT: }

+ 0 - 2
toolchain/check/testdata/interface/fail_modifiers.carbon → toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon

@@ -42,13 +42,11 @@ protected interface Protected;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Abstract = %Abstract.decl
 // CHECK:STDOUT:     .Default = %Default.decl
 // CHECK:STDOUT:     .Virtual = %Virtual.decl
 // CHECK:STDOUT:     .Protected = %Protected.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Abstract.decl: type = interface_decl @Abstract [template = constants.%.1] {}
 // CHECK:STDOUT:   %Default.decl: type = interface_decl @Default [template = constants.%.2] {}
 // CHECK:STDOUT:   %Virtual.decl: type = interface_decl @Virtual [template = constants.%.3] {}

+ 0 - 2
toolchain/check/testdata/interface/fail_redeclare_member.carbon → toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon

@@ -26,10 +26,8 @@ interface Interface {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Interface = %Interface.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/interface/fail_todo_facet_lookup.carbon → toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon

@@ -34,12 +34,10 @@ fn CallFacet(T:! Interface, x: T) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Interface = %Interface.decl
 // CHECK:STDOUT:     .CallStatic = %CallStatic
 // CHECK:STDOUT:     .CallFacet = %CallFacet
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {}
 // CHECK:STDOUT:   %CallStatic: <function> = fn_decl @CallStatic [template] {
 // CHECK:STDOUT:     %Interface.ref.loc9: type = name_ref Interface, %Interface.decl [template = constants.%.1]

+ 0 - 2
toolchain/check/testdata/interface/fail_todo_generic.carbon → toolchain/check/testdata/interface/no_prelude/fail_todo_generic.carbon

@@ -21,10 +21,8 @@ interface I[]();
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .I = %I.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %I.decl: type = interface_decl @I [template = constants.%.1] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/interface/fail_todo_modifiers.carbon → toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon

@@ -37,11 +37,9 @@ private interface Private {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Modifiers = %Modifiers.decl
 // CHECK:STDOUT:     .Private = %Private.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Modifiers.decl: type = interface_decl @Modifiers [template = constants.%.1] {}
 // CHECK:STDOUT:   %Private.decl: type = interface_decl @Private [template = constants.%.5] {}
 // CHECK:STDOUT: }

+ 29 - 33
toolchain/check/testdata/interface/import.carbon → toolchain/check/testdata/interface/no_prelude/import.carbon

@@ -16,7 +16,8 @@ interface Basic {
   fn F();
 }
 
-interface ForwardDeclared;
+// TODO: Implement merging of interface on import.
+// interface ForwardDeclared;
 
 interface ForwardDeclared {
   let T:! type;
@@ -67,19 +68,16 @@ var f: ForwardDeclared* = &f_ref.f;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Empty = %Empty.decl
 // CHECK:STDOUT:     .Basic = %Basic.decl
-// CHECK:STDOUT:     .ForwardDeclared = %ForwardDeclared.decl.loc12
+// CHECK:STDOUT:     .ForwardDeclared = %ForwardDeclared.decl
 // CHECK:STDOUT:     .f_ref = %f_ref
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {}
 // CHECK:STDOUT:   %Basic.decl: type = interface_decl @Basic [template = constants.%.2] {}
-// CHECK:STDOUT:   %ForwardDeclared.decl.loc12: type = interface_decl @ForwardDeclared [template = constants.%.7] {}
-// CHECK:STDOUT:   %ForwardDeclared.decl.loc14: type = interface_decl @ForwardDeclared [template = constants.%.7] {}
-// CHECK:STDOUT:   %ForwardDeclared.ref: type = name_ref ForwardDeclared, %ForwardDeclared.decl.loc12 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc19: type = struct_type {.f: ForwardDeclared} [template = constants.%.12]
+// CHECK:STDOUT:   %ForwardDeclared.decl: type = interface_decl @ForwardDeclared [template = constants.%.7] {}
+// CHECK:STDOUT:   %ForwardDeclared.ref: type = name_ref ForwardDeclared, %ForwardDeclared.decl [template = constants.%.7]
+// CHECK:STDOUT:   %.loc20: type = struct_type {.f: ForwardDeclared} [template = constants.%.12]
 // CHECK:STDOUT:   %f_ref.var: ref {.f: ForwardDeclared} = var f_ref
 // CHECK:STDOUT:   %f_ref: ref {.f: ForwardDeclared} = bind_name f_ref, %f_ref.var
 // CHECK:STDOUT: }
@@ -109,14 +107,14 @@ var f: ForwardDeclared* = &f_ref.f;
 // CHECK:STDOUT: interface @ForwardDeclared {
 // CHECK:STDOUT:   %Self: ForwardDeclared = bind_symbolic_name Self 0 [symbolic = constants.%Self.3]
 // CHECK:STDOUT:   %T: type = assoc_const_decl T [template]
-// CHECK:STDOUT:   %.loc15: <associated type in ForwardDeclared> = assoc_entity element0, %T [template = constants.%.9]
+// CHECK:STDOUT:   %.loc16: <associated type in ForwardDeclared> = assoc_entity element0, %T [template = constants.%.9]
 // CHECK:STDOUT:   %F: <function> = fn_decl @F.2 [template] {}
-// CHECK:STDOUT:   %.loc16: <associated <function> in ForwardDeclared> = assoc_entity element1, %F [template = constants.%.11]
+// CHECK:STDOUT:   %.loc17: <associated <function> in ForwardDeclared> = assoc_entity element1, %F [template = constants.%.11]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .Self = %Self
-// CHECK:STDOUT:   .T = %.loc15
-// CHECK:STDOUT:   .F = %.loc16
+// CHECK:STDOUT:   .T = %.loc16
+// CHECK:STDOUT:   .F = %.loc17
 // CHECK:STDOUT:   witness = (%T, %F)
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -153,7 +151,6 @@ var f: ForwardDeclared* = &f_ref.f;
 // CHECK:STDOUT:     .Basic = %import_ref.2
 // CHECK:STDOUT:     .ForwardDeclared = %import_ref.3
 // CHECK:STDOUT:     .f_ref = %import_ref.4
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .UseEmpty = %UseEmpty
 // CHECK:STDOUT:     .UseBasic = %UseBasic
 // CHECK:STDOUT:     .UseForwardDeclared = %UseForwardDeclared
@@ -163,34 +160,33 @@ var f: ForwardDeclared* = &f_ref.f;
 // CHECK:STDOUT:     .UseForwardDeclaredF = %UseForwardDeclaredF
 // CHECK:STDOUT:     .f = %f.loc16
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.1: type = import_ref ir1, inst+2, loc_13 [template = constants.%.1]
-// CHECK:STDOUT:   %import_ref.2: type = import_ref ir1, inst+6, loc_22 [template = constants.%.3]
-// CHECK:STDOUT:   %import_ref.3: type = import_ref ir1, inst+18, loc_31 [template = constants.%.4]
-// CHECK:STDOUT:   %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir1, inst+40, loc_70
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %import_ref.5 = import_ref ir1, inst+4, unloaded
+// CHECK:STDOUT:   %import_ref.1: type = import_ref ir1, inst+1, loc_13 [template = constants.%.1]
+// CHECK:STDOUT:   %import_ref.2: type = import_ref ir1, inst+5, loc_22 [template = constants.%.3]
+// CHECK:STDOUT:   %import_ref.3: type = import_ref ir1, inst+17, loc_31 [template = constants.%.4]
+// CHECK:STDOUT:   %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir1, inst+38, loc_70
+// CHECK:STDOUT:   %import_ref.5 = import_ref ir1, inst+3, unloaded
 // CHECK:STDOUT:   %UseEmpty: <function> = fn_decl @UseEmpty [template] {
 // CHECK:STDOUT:     %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {}
 // CHECK:STDOUT:     %Empty.ref: type = name_ref Empty, %import_ref.1 [template = constants.%.1]
 // CHECK:STDOUT:     %e.loc6_13.1: Empty = param e
 // CHECK:STDOUT:     @UseEmpty.%e: Empty = bind_name e, %e.loc6_13.1
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.6 = import_ref ir1, inst+8, unloaded
-// CHECK:STDOUT:   %import_ref.7: <associated <function> in Basic> = import_ref ir1, inst+16, loc_48 [template = constants.%.8]
-// CHECK:STDOUT:   %import_ref.8: <associated type in Basic> = import_ref ir1, inst+12, loc_41 [template = constants.%.6]
-// CHECK:STDOUT:   %import_ref.9 = import_ref ir1, inst+10, unloaded
-// CHECK:STDOUT:   %import_ref.10 = import_ref ir1, inst+14, unloaded
+// CHECK:STDOUT:   %import_ref.6 = import_ref ir1, inst+7, unloaded
+// CHECK:STDOUT:   %import_ref.7: <associated <function> in Basic> = import_ref ir1, inst+15, loc_48 [template = constants.%.8]
+// CHECK:STDOUT:   %import_ref.8: <associated type in Basic> = import_ref ir1, inst+11, loc_41 [template = constants.%.6]
+// CHECK:STDOUT:   %import_ref.9 = import_ref ir1, inst+9, unloaded
+// CHECK:STDOUT:   %import_ref.10 = import_ref ir1, inst+13, unloaded
 // CHECK:STDOUT:   %UseBasic: <function> = fn_decl @UseBasic [template] {
 // CHECK:STDOUT:     %Basic.decl: type = interface_decl @Basic [template = constants.%.3] {}
 // CHECK:STDOUT:     %Basic.ref.loc7: type = name_ref Basic, %import_ref.2 [template = constants.%.3]
 // CHECK:STDOUT:     %e.loc7_13.1: Basic = param e
 // CHECK:STDOUT:     @UseBasic.%e: Basic = bind_name e, %e.loc7_13.1
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref.11 = import_ref ir1, inst+21, unloaded
-// CHECK:STDOUT:   %import_ref.12: <associated <function> in ForwardDeclared> = import_ref ir1, inst+29, loc_62 [template = constants.%.12]
-// CHECK:STDOUT:   %import_ref.13: <associated type in ForwardDeclared> = import_ref ir1, inst+25, loc_55 [template = constants.%.10]
-// CHECK:STDOUT:   %import_ref.14 = import_ref ir1, inst+23, unloaded
-// CHECK:STDOUT:   %import_ref.15 = import_ref ir1, inst+27, unloaded
+// CHECK:STDOUT:   %import_ref.11 = import_ref ir1, inst+19, unloaded
+// CHECK:STDOUT:   %import_ref.12: <associated <function> in ForwardDeclared> = import_ref ir1, inst+27, loc_62 [template = constants.%.12]
+// CHECK:STDOUT:   %import_ref.13: <associated type in ForwardDeclared> = import_ref ir1, inst+23, loc_55 [template = constants.%.10]
+// CHECK:STDOUT:   %import_ref.14 = import_ref ir1, inst+21, unloaded
+// CHECK:STDOUT:   %import_ref.15 = import_ref ir1, inst+25, unloaded
 // CHECK:STDOUT:   %UseForwardDeclared: <function> = fn_decl @UseForwardDeclared [template] {
 // CHECK:STDOUT:     %ForwardDeclared.decl: type = interface_decl @ForwardDeclared [template = constants.%.4] {}
 // CHECK:STDOUT:     %ForwardDeclared.ref.loc8: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4]
@@ -198,19 +194,19 @@ var f: ForwardDeclared* = &f_ref.f;
 // CHECK:STDOUT:     @UseForwardDeclared.%f: ForwardDeclared = bind_name f, %f.loc8_23.1
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %Basic.ref.loc10: type = name_ref Basic, %import_ref.2 [template = constants.%.3]
-// CHECK:STDOUT:   %import_ref.16 = import_ref ir1, inst+10, unloaded
+// CHECK:STDOUT:   %import_ref.16 = import_ref ir1, inst+9, unloaded
 // CHECK:STDOUT:   %T.ref.loc10: <associated type in Basic> = name_ref T, %import_ref.8 [template = constants.%.6]
 // CHECK:STDOUT:   %UseBasicT: <associated type in Basic> = bind_alias UseBasicT, %import_ref.8 [template = constants.%.6]
 // CHECK:STDOUT:   %Basic.ref.loc11: type = name_ref Basic, %import_ref.2 [template = constants.%.3]
-// CHECK:STDOUT:   %import_ref.17 = import_ref ir1, inst+14, unloaded
+// CHECK:STDOUT:   %import_ref.17 = import_ref ir1, inst+13, unloaded
 // CHECK:STDOUT:   %F.ref.loc11: <associated <function> in Basic> = name_ref F, %import_ref.7 [template = constants.%.8]
 // CHECK:STDOUT:   %UseBasicF: <associated <function> in Basic> = bind_alias UseBasicF, %import_ref.7 [template = constants.%.8]
 // CHECK:STDOUT:   %ForwardDeclared.ref.loc13: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4]
-// CHECK:STDOUT:   %import_ref.18 = import_ref ir1, inst+23, unloaded
+// CHECK:STDOUT:   %import_ref.18 = import_ref ir1, inst+21, unloaded
 // CHECK:STDOUT:   %T.ref.loc13: <associated type in ForwardDeclared> = name_ref T, %import_ref.13 [template = constants.%.10]
 // CHECK:STDOUT:   %UseForwardDeclaredT: <associated type in ForwardDeclared> = bind_alias UseForwardDeclaredT, %import_ref.13 [template = constants.%.10]
 // CHECK:STDOUT:   %ForwardDeclared.ref.loc14: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4]
-// CHECK:STDOUT:   %import_ref.19 = import_ref ir1, inst+27, unloaded
+// CHECK:STDOUT:   %import_ref.19 = import_ref ir1, inst+25, unloaded
 // CHECK:STDOUT:   %F.ref.loc14: <associated <function> in ForwardDeclared> = name_ref F, %import_ref.12 [template = constants.%.12]
 // CHECK:STDOUT:   %UseForwardDeclaredF: <associated <function> in ForwardDeclared> = bind_alias UseForwardDeclaredF, %import_ref.12 [template = constants.%.12]
 // CHECK:STDOUT:   %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4]

+ 0 - 2
toolchain/check/testdata/interface/self.carbon → toolchain/check/testdata/interface/no_prelude/self.carbon

@@ -19,10 +19,8 @@ interface UseSelf {
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .UseSelf = %UseSelf.decl
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/struct/empty.carbon → toolchain/check/testdata/struct/no_prelude/empty.carbon

@@ -17,11 +17,9 @@ var y: {} = x;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .x = %x
 // CHECK:STDOUT:     .y = %y
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %.loc7_9.1: {} = struct_literal ()
 // CHECK:STDOUT:   %.loc7_9.2: type = converted %.loc7_9.1, constants.%.1 [template = constants.%.1]
 // CHECK:STDOUT:   %x.var: ref {} = var x

+ 0 - 2
toolchain/check/testdata/struct/fail_assign_nested.carbon → toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon

@@ -21,10 +21,8 @@ var x: {.a: {}} = {.b = {}};
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .x = %x
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %.loc10_14.1: {} = struct_literal ()
 // CHECK:STDOUT:   %.loc10_14.2: type = converted %.loc10_14.1, constants.%.1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc10_15: type = struct_type {.a: {}} [template = constants.%.2]

+ 0 - 2
toolchain/check/testdata/struct/fail_nested_incomplete.carbon → toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon

@@ -26,12 +26,10 @@ var p: Incomplete* = &s.a;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Incomplete = %Incomplete.decl
 // CHECK:STDOUT:     .s = %s
 // CHECK:STDOUT:     .p = %p
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {}
 // CHECK:STDOUT:   %Incomplete.ref.loc15: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
 // CHECK:STDOUT:   %.loc15: type = struct_type {.a: Incomplete} [template = constants.%.1]

+ 0 - 2
toolchain/check/testdata/tuples/empty.carbon → toolchain/check/testdata/tuples/no_prelude/empty.carbon

@@ -16,11 +16,9 @@ var y: () = x;
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .x = %x
 // CHECK:STDOUT:     .y = %y
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %.loc7_9.1: () = tuple_literal ()
 // CHECK:STDOUT:   %.loc7_9.2: type = converted %.loc7_9.1, constants.%.1 [template = constants.%.1]
 // CHECK:STDOUT:   %x.var: ref () = var x

+ 12 - 13
toolchain/check/testdata/tuples/fail_assign_empty.carbon → toolchain/check/testdata/tuples/no_prelude/fail_assign_empty.carbon

@@ -4,29 +4,28 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:17: ERROR: Cannot initialize tuple of 1 element(s) from tuple with 0 element(s).
-// CHECK:STDERR: var x: (i32,) = ();
-// CHECK:STDERR:                 ^~
-var x: (i32,) = ();
+// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:16: ERROR: Cannot initialize tuple of 1 element(s) from tuple with 0 element(s).
+// CHECK:STDERR: var x: ((),) = ();
+// CHECK:STDERR:                ^~
+var x: ((),) = ();
 
 // CHECK:STDOUT: --- fail_assign_empty.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: type = tuple_type (type) [template]
-// CHECK:STDOUT:   %.2: type = tuple_type (i32) [template]
-// CHECK:STDOUT:   %.3: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (()) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .x = %x
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %.loc10_13.1: (type,) = tuple_literal (i32)
-// CHECK:STDOUT:   %.loc10_13.2: type = converted %.loc10_13.1, constants.%.2 [template = constants.%.2]
-// CHECK:STDOUT:   %x.var: ref (i32,) = var x
-// CHECK:STDOUT:   %x: ref (i32,) = bind_name x, %x.var
+// CHECK:STDOUT:   %.loc10_10: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc10_12.1: ((),) = tuple_literal (%.loc10_10)
+// CHECK:STDOUT:   %.loc10_12.2: type = converted %.loc10_10, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_12.3: type = converted %.loc10_12.1, constants.%.2 [template = constants.%.2]
+// CHECK:STDOUT:   %x.var: ref ((),) = var x
+// CHECK:STDOUT:   %x: ref ((),) = bind_name x, %x.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {

+ 7 - 8
toolchain/check/testdata/tuples/fail_assign_to_empty.carbon → toolchain/check/testdata/tuples/no_prelude/fail_assign_to_empty.carbon

@@ -4,24 +4,22 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:1: ERROR: Cannot implicitly convert from `i32` to `()`.
-// CHECK:STDERR: var x: () = (66);
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
-var x: () = (66);
+// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: ERROR: Cannot initialize tuple of 0 element(s) from tuple with 1 element(s).
+// CHECK:STDERR: var x: () = ((),);
+// CHECK:STDERR:             ^~~~~
+var x: () = ((),);
 
 // CHECK:STDOUT: --- fail_assign_to_empty.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %.1: type = tuple_type () [template]
-// CHECK:STDOUT:   %.2: i32 = int_literal 66 [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (()) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .x = %x
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %.loc10_9.1: () = tuple_literal ()
 // CHECK:STDOUT:   %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1]
 // CHECK:STDOUT:   %x.var: ref () = var x
@@ -30,7 +28,8 @@ var x: () = (66);
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc10: i32 = int_literal 66 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc10_15: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc10_17: ((),) = tuple_literal (%.loc10_15)
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 0 - 46
toolchain/check/testdata/var/fail_duplicate_decl.carbon

@@ -1,46 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-
-fn Main() {
-  var x: i32 = 0;
-  // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope.
-  // CHECK:STDERR:   var x: i32 = 0;
-  // CHECK:STDERR:       ^
-  // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: Name is previously declared here.
-  // CHECK:STDERR:   var x: i32 = 0;
-  // CHECK:STDERR:       ^
-  var x: i32 = 0;
-}
-
-// CHECK:STDOUT: --- fail_duplicate_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .Main = %Main
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Main() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var.loc9: ref i32 = var x
-// CHECK:STDOUT:   %x.loc9: ref i32 = bind_name x, %x.var.loc9
-// CHECK:STDOUT:   %.loc9: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign %x.var.loc9, %.loc9
-// CHECK:STDOUT:   %x.var.loc16: ref i32 = var x
-// CHECK:STDOUT:   %x.loc16: ref i32 = bind_name x, %x.var.loc16
-// CHECK:STDOUT:   %.loc16: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign %x.var.loc16, %.loc16
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 38
toolchain/check/testdata/var/fail_generic.carbon

@@ -1,38 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-fn Main() {
-  // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:11: ERROR: `var` declaration cannot declare a compile-time binding.
-  // CHECK:STDERR:   var x:! i32 = 0;
-  // CHECK:STDERR:           ^~~
-  var x:! i32 = 0;
-}
-
-// CHECK:STDOUT: --- fail_generic.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %x: i32 = bind_symbolic_name x 0 [symbolic]
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .Main = %Main
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Main() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: i32 = bind_symbolic_name x 0, %x.var [symbolic = constants.%x]
-// CHECK:STDOUT:   %.loc11: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign %x.var, %.loc11
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 20
toolchain/check/testdata/var/global_decl.carbon

@@ -1,20 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-var x: i32;
-
-// CHECK:STDOUT: --- global_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 31
toolchain/check/testdata/var/global_decl_with_init.carbon

@@ -1,31 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-var x: i32 = 0;
-
-// CHECK:STDOUT: --- global_decl_with_init.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @__global_init() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign file.%x.var, %.loc7
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 38
toolchain/check/testdata/var/global_lookup.carbon

@@ -1,38 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-var x: i32 = 0;
-var y: i32 = x;
-
-// CHECK:STDOUT: --- global_lookup.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:     .y = %y
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT:   %y.var: ref i32 = var y
-// CHECK:STDOUT:   %y: ref i32 = bind_name y, %y.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @__global_init() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign file.%x.var, %.loc7
-// CHECK:STDOUT:   %x.ref: ref i32 = name_ref x, file.%x
-// CHECK:STDOUT:   %.loc8: i32 = bind_value %x.ref
-// CHECK:STDOUT:   assign file.%y.var, %.loc8
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 47
toolchain/check/testdata/var/global_lookup_in_scope.carbon

@@ -1,47 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-var x: i32 = 0;
-
-fn Main() {
-  var y: i32 = x;
-}
-
-// CHECK:STDOUT: --- global_lookup_in_scope.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:     .Main = %Main
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Main() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %y.var: ref i32 = var y
-// CHECK:STDOUT:   %y: ref i32 = bind_name y, %y.var
-// CHECK:STDOUT:   %x.ref: ref i32 = name_ref x, file.%x
-// CHECK:STDOUT:   %.loc10: i32 = bind_value %x.ref
-// CHECK:STDOUT:   assign %y.var, %.loc10
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @__global_init() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign file.%x.var, %.loc7
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 63
toolchain/check/testdata/var/import.carbon

@@ -1,63 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-// --- implicit.carbon
-
-package Implicit api;
-
-var a_ref: i32 = 0;
-
-// --- implicit.impl.carbon
-
-package Implicit impl;
-
-var a: i32 = a_ref;
-
-// CHECK:STDOUT: --- implicit.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .a_ref = %a_ref
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %a_ref.var: ref i32 = var a_ref
-// CHECK:STDOUT:   %a_ref: ref i32 = bind_name a_ref, %a_ref.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @__global_init() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc4: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign file.%a_ref.var, %.loc4
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: --- implicit.impl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .a_ref = %import_ref
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %import_ref: ref i32 = import_ref ir0, inst+3, loc_10
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %a.var: ref i32 = var a
-// CHECK:STDOUT:   %a: ref i32 = bind_name a, %a.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @__global_init() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %a_ref.ref: ref i32 = name_ref a_ref, file.%import_ref
-// CHECK:STDOUT:   %.loc4: i32 = bind_value %a_ref.ref
-// CHECK:STDOUT:   assign file.%a.var, %.loc4
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 0 - 36
toolchain/check/testdata/var/lookup.carbon

@@ -1,36 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-
-fn Main() {
-  var x: i32 = 0;
-  x;
-}
-
-// CHECK:STDOUT: --- lookup.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
-// CHECK:STDOUT:     .Main = %Main
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Main() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign %x.var, %.loc8
-// CHECK:STDOUT:   %x.ref: ref i32 = name_ref x, %x
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 9 - 5
toolchain/check/testdata/var/decl.carbon → toolchain/check/testdata/var/no_prelude/decl.carbon

@@ -5,24 +5,28 @@
 // AUTOUPDATE
 
 fn Main() {
-  var x: i32;
+  var x: ();
 }
 
 // CHECK:STDOUT: --- decl.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
+// CHECK:STDOUT:   %.loc8_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_11.2: type = converted %.loc8_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var: ref () = var x
+// CHECK:STDOUT:   %x: ref () = bind_name x, %x.var
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 11 - 8
toolchain/check/testdata/var/decl_with_init.carbon → toolchain/check/testdata/var/no_prelude/decl_with_init.carbon

@@ -5,30 +5,33 @@
 // AUTOUPDATE
 
 fn Main() {
-  var x: i32 = 0;
+  var x: () = ();
 }
 
 // CHECK:STDOUT: --- decl_with_init.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 0 [template = constants.%.1]
-// CHECK:STDOUT:   assign %x.var, %.loc8
+// CHECK:STDOUT:   %.loc8_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_11.2: type = converted %.loc8_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var: ref () = var x
+// CHECK:STDOUT:   %x: ref () = bind_name x, %x.var
+// CHECK:STDOUT:   %.loc8_16.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_16.2: init () = tuple_init () to %x.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc8_17: init () = converted %.loc8_16.1, %.loc8_16.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign %x.var, %.loc8_17
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 53 - 0
toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon

@@ -0,0 +1,53 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+
+fn Main() {
+  var x: () = ();
+  // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope.
+  // CHECK:STDERR:   var x: () = ();
+  // CHECK:STDERR:       ^
+  // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: Name is previously declared here.
+  // CHECK:STDERR:   var x: () = ();
+  // CHECK:STDERR:       ^
+  var x: () = ();
+}
+
+// CHECK:STDOUT: --- fail_duplicate_decl.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .Main = %Main
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Main() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc9_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc9_11.2: type = converted %.loc9_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var.loc9: ref () = var x
+// CHECK:STDOUT:   %x.loc9: ref () = bind_name x, %x.var.loc9
+// CHECK:STDOUT:   %.loc9_16.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc9_16.2: init () = tuple_init () to %x.var.loc9 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc9_17: init () = converted %.loc9_16.1, %.loc9_16.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign %x.var.loc9, %.loc9_17
+// CHECK:STDOUT:   %.loc16_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc16_11.2: type = converted %.loc16_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var.loc16: ref () = var x
+// CHECK:STDOUT:   %x.loc16: ref () = bind_name x, %x.var.loc16
+// CHECK:STDOUT:   %.loc16_16.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc16_16.2: init () = tuple_init () to %x.var.loc16 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc16_17: init () = converted %.loc16_16.1, %.loc16_16.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign %x.var.loc16, %.loc16_17
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 41 - 0
toolchain/check/testdata/var/no_prelude/fail_generic.carbon

@@ -0,0 +1,41 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+fn Main() {
+  // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:11: ERROR: `var` declaration cannot declare a compile-time binding.
+  // CHECK:STDERR:   var x:! () = ();
+  // CHECK:STDERR:           ^~
+  var x:! () = ();
+}
+
+// CHECK:STDOUT: --- fail_generic.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %x: () = bind_symbolic_name x 0 [symbolic]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .Main = %Main
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Main() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc11_12.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var: ref () = var x
+// CHECK:STDOUT:   %x: () = bind_symbolic_name x 0, %x.var [symbolic = constants.%x]
+// CHECK:STDOUT:   %.loc11_17.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc11_17.2: init () = tuple_init () to %x.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc11_18: init () = converted %.loc11_17.1, %.loc11_17.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign %x.var, %.loc11_18
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 11 - 10
toolchain/check/testdata/var/fail_init_type_mismatch.carbon → toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon

@@ -5,32 +5,33 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`.
-  // CHECK:STDERR:   var x: i32 = 1.0;
-  // CHECK:STDERR:   ^~~~~~~~~~~~~~~~~
-  var x: i32 = 1.0;
+  // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:3: ERROR: Cannot implicitly convert from `()` to `{}`.
+  // CHECK:STDERR:   var x: {} = ();
+  // CHECK:STDERR:   ^~~~~~~~~~~~~~~
+  var x: {} = ();
 }
 
 // CHECK:STDOUT: --- fail_init_type_mismatch.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: f64 = float_literal 1 [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT:   %.loc11: f64 = float_literal 1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc11_11.1: {} = struct_literal ()
+// CHECK:STDOUT:   %.loc11_11.2: type = converted %.loc11_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var: ref {} = var x
+// CHECK:STDOUT:   %x: ref {} = bind_name x, %x.var
+// CHECK:STDOUT:   %.loc11_16: () = tuple_literal ()
 // CHECK:STDOUT:   assign %x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 12 - 8
toolchain/check/testdata/var/fail_init_with_self.carbon → toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon

@@ -5,27 +5,31 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:16: ERROR: Name `x` not found.
-  // CHECK:STDERR:   var x: i32 = x;
-  // CHECK:STDERR:                ^
-  var x: i32 = x;
+  // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:15: ERROR: Name `x` not found.
+  // CHECK:STDERR:   var x: () = x;
+  // CHECK:STDERR:               ^
+  var x: () = x;
 }
 
 // CHECK:STDOUT: --- fail_init_with_self.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
+// CHECK:STDOUT:   %.loc11_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc11_11.2: type = converted %.loc11_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var: ref () = var x
+// CHECK:STDOUT:   %x: ref () = bind_name x, %x.var
 // CHECK:STDOUT:   %x.ref: <error> = name_ref x, <error> [template = <error>]
 // CHECK:STDOUT:   assign %x.var, <error>
 // CHECK:STDOUT:   return

+ 17 - 11
toolchain/check/testdata/var/fail_lookup_outside_scope.carbon → toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon

@@ -5,32 +5,38 @@
 // AUTOUPDATE
 
 fn Main() {
-  var x: i32;
+  var x: ();
 }
 
-// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:14: ERROR: Name `x` not found.
-// CHECK:STDERR: var y: i32 = x;
-// CHECK:STDERR:              ^
-var y: i32 = x;
+// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:13: ERROR: Name `x` not found.
+// CHECK:STDERR: var y: () = x;
+// CHECK:STDERR:             ^
+var y: () = x;
 
 // CHECK:STDOUT: --- fail_lookup_outside_scope.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .Main = %Main
 // CHECK:STDOUT:     .y = %y
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
-// CHECK:STDOUT:   %y.var: ref i32 = var y
-// CHECK:STDOUT:   %y: ref i32 = bind_name y, %y.var
+// CHECK:STDOUT:   %.loc14_9.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc14_9.2: type = converted %.loc14_9.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %y.var: ref () = var y
+// CHECK:STDOUT:   %y: ref () = bind_name y, %y.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.var: ref i32 = var x
-// CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
+// CHECK:STDOUT:   %.loc8_11.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_11.2: type = converted %.loc8_11.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %x.var: ref () = var x
+// CHECK:STDOUT:   %x: ref () = bind_name x, %x.var
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 32 - 22
toolchain/check/testdata/var/fail_modifiers.carbon → toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon

@@ -5,60 +5,70 @@
 // AUTOUPDATE
 
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `protected` not allowed on `var` declaration at file scope, `protected` is only allowed on class members.
-// CHECK:STDERR: protected var b: i32;
+// CHECK:STDERR: protected var b: ();
 // CHECK:STDERR: ^~~~~~~~~
 // CHECK:STDERR:
-protected var b: i32;
+protected var b: ();
 
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: Semantics TODO: `access modifier`.
-// CHECK:STDERR: private protected var c: i32;
+// CHECK:STDERR: private protected var c: ();
 // CHECK:STDERR: ^~~~~~~
 // CHECK:STDERR:
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `protected` not allowed on declaration with `private`.
-// CHECK:STDERR: private protected var c: i32;
+// CHECK:STDERR: private protected var c: ();
 // CHECK:STDERR:         ^~~~~~~~~
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here.
-// CHECK:STDERR: private protected var c: i32;
+// CHECK:STDERR: private protected var c: ();
 // CHECK:STDERR: ^~~~~~~
 // CHECK:STDERR:
-private protected var c: i32;
+private protected var c: ();
 
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `protected` not allowed on `var` declaration at file scope, `protected` is only allowed on class members.
-// CHECK:STDERR: protected protected var d: i32;
+// CHECK:STDERR: protected protected var d: ();
 // CHECK:STDERR: ^~~~~~~~~
 // CHECK:STDERR:
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: ERROR: `protected` repeated on declaration.
-// CHECK:STDERR: protected protected var d: i32;
+// CHECK:STDERR: protected protected var d: ();
 // CHECK:STDERR:           ^~~~~~~~~
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `protected` previously appeared here.
-// CHECK:STDERR: protected protected var d: i32;
+// CHECK:STDERR: protected protected var d: ();
 // CHECK:STDERR: ^~~~~~~~~
 // CHECK:STDERR:
-protected protected var d: i32;
+protected protected var d: ();
 
 // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `abstract` not allowed on `var` declaration.
-// CHECK:STDERR: abstract var e: i32;
+// CHECK:STDERR: abstract var e: ();
 // CHECK:STDERR: ^~~~~~~~
-abstract var e: i32;
+abstract var e: ();
 
 // CHECK:STDOUT: --- fail_modifiers.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .b = %b
 // CHECK:STDOUT:     .c = %c
 // CHECK:STDOUT:     .d = %d
 // CHECK:STDOUT:     .e = %e
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %b.var: ref i32 = var b
-// CHECK:STDOUT:   %b: ref i32 = bind_name b, %b.var
-// CHECK:STDOUT:   %c.var: ref i32 = var c
-// CHECK:STDOUT:   %c: ref i32 = bind_name c, %c.var
-// CHECK:STDOUT:   %d.var: ref i32 = var d
-// CHECK:STDOUT:   %d: ref i32 = bind_name d, %d.var
-// CHECK:STDOUT:   %e.var: ref i32 = var e
-// CHECK:STDOUT:   %e: ref i32 = bind_name e, %e.var
+// CHECK:STDOUT:   %.loc11_19.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc11_19.2: type = converted %.loc11_19.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %b.var: ref () = var b
+// CHECK:STDOUT:   %b: ref () = bind_name b, %b.var
+// CHECK:STDOUT:   %.loc24_27.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc24_27.2: type = converted %.loc24_27.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %c.var: ref () = var c
+// CHECK:STDOUT:   %c: ref () = bind_name c, %c.var
+// CHECK:STDOUT:   %.loc37_29.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc37_29.2: type = converted %.loc37_29.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %d.var: ref () = var d
+// CHECK:STDOUT:   %d: ref () = bind_name d, %d.var
+// CHECK:STDOUT:   %.loc42_18.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc42_18.2: type = converted %.loc42_18.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %e.var: ref () = var e
+// CHECK:STDOUT:   %e: ref () = bind_name e, %e.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 18 - 13
toolchain/check/testdata/var/fail_namespace_conflict.carbon → toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon

@@ -7,45 +7,50 @@
 namespace A;
 
 // CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+7]]:5: ERROR: Duplicate name being declared in the same scope.
-// CHECK:STDERR: var A: i32;
+// CHECK:STDERR: var A: ();
 // CHECK:STDERR:     ^
 // CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-5]]:1: Name is previously declared here.
 // CHECK:STDERR: namespace A;
 // CHECK:STDERR: ^~~~~~~~~~~~
 // CHECK:STDERR:
-var A: i32;
+var A: ();
 
 // CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+6]]:5: ERROR: Duplicate name being declared in the same scope.
-// CHECK:STDERR: var A: i32 = 1;
+// CHECK:STDERR: var A: () = ();
 // CHECK:STDERR:     ^
 // CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: Name is previously declared here.
 // CHECK:STDERR: namespace A;
 // CHECK:STDERR: ^~~~~~~~~~~~
-var A: i32 = 1;
+var A: () = ();
 
 // CHECK:STDOUT: --- fail_namespace_conflict.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .A = %A.loc7
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
 // CHECK:STDOUT:   %A.loc7: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %A.var.loc16: ref i32 = var A
-// CHECK:STDOUT:   %A.loc16: ref i32 = bind_name A, %A.var.loc16
-// CHECK:STDOUT:   %A.var.loc24: ref i32 = var A
-// CHECK:STDOUT:   %A.loc24: ref i32 = bind_name A, %A.var.loc24
+// CHECK:STDOUT:   %.loc16_9.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc16_9.2: type = converted %.loc16_9.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %A.var.loc16: ref () = var A
+// CHECK:STDOUT:   %A.loc16: ref () = bind_name A, %A.var.loc16
+// CHECK:STDOUT:   %.loc24_9.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc24_9.2: type = converted %.loc24_9.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %A.var.loc24: ref () = var A
+// CHECK:STDOUT:   %A.loc24: ref () = bind_name A, %A.var.loc24
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc24: i32 = int_literal 1 [template = constants.%.1]
-// CHECK:STDOUT:   assign file.%A.var.loc24, %.loc24
+// CHECK:STDOUT:   %.loc24_14.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc24_14.2: init () = tuple_init () to file.%A.var.loc24 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc24_15: init () = converted %.loc24_14.1, %.loc24_14.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign file.%A.var.loc24, %.loc24_15
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 10 - 6
toolchain/check/testdata/var/fail_todo_modifiers.carbon → toolchain/check/testdata/var/no_prelude/fail_todo_modifiers.carbon

@@ -5,19 +5,23 @@
 // AUTOUPDATE
 
 // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `access modifier`.
-// CHECK:STDERR: private var a: i32;
+// CHECK:STDERR: private var a: ();
 // CHECK:STDERR: ^~~~~~~
-private var a: i32;
+private var a: ();
 
 // CHECK:STDOUT: --- fail_todo_modifiers.carbon
 // CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace [template] {
-// CHECK:STDOUT:     .Core = %Core
 // CHECK:STDOUT:     .a = %a
 // CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core: <namespace> = namespace [template] {}
-// CHECK:STDOUT:   %a.var: ref i32 = var a
-// CHECK:STDOUT:   %a: ref i32 = bind_name a, %a.var
+// CHECK:STDOUT:   %.loc10_17.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc10_17.2: type = converted %.loc10_17.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %a.var: ref () = var a
+// CHECK:STDOUT:   %a: ref () = bind_name a, %a.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 26 - 0
toolchain/check/testdata/var/no_prelude/global_decl.carbon

@@ -0,0 +1,26 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+var x: {.v: ()};
+
+// CHECK:STDOUT: --- global_decl.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = struct_type {.v: ()} [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .x = %x
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc7_14.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_14.2: type = converted %.loc7_14.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc7_15: type = struct_type {.v: ()} [template = constants.%.2]
+// CHECK:STDOUT:   %x.var: ref {.v: ()} = var x
+// CHECK:STDOUT:   %x: ref {.v: ()} = bind_name x, %x.var
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 41 - 0
toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon

@@ -0,0 +1,41 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+var x: {.v: ()} = {.v = ()};
+
+// CHECK:STDOUT: --- global_decl_with_init.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = struct_type {.v: ()} [template]
+// CHECK:STDOUT:   %.3: () = tuple_value () [template]
+// CHECK:STDOUT:   %.4: {.v: ()} = struct_value (%.3) [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .x = %x
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc7_14.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_14.2: type = converted %.loc7_14.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc7_15: type = struct_type {.v: ()} [template = constants.%.2]
+// CHECK:STDOUT:   %x.var: ref {.v: ()} = var x
+// CHECK:STDOUT:   %x: ref {.v: ()} = bind_name x, %x.var
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc7_26.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_27.1: {.v: ()} = struct_literal (%.loc7_26.1)
+// CHECK:STDOUT:   %.loc7_27.2: ref () = struct_access file.%x.var, element0
+// CHECK:STDOUT:   %.loc7_26.2: init () = tuple_init () to %.loc7_27.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc7_27.3: init () = converted %.loc7_26.1, %.loc7_26.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc7_27.4: init {.v: ()} = struct_init (%.loc7_27.3) to file.%x.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_28: init {.v: ()} = converted %.loc7_27.1, %.loc7_27.4 [template = constants.%.4]
+// CHECK:STDOUT:   assign file.%x.var, %.loc7_28
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 56 - 0
toolchain/check/testdata/var/no_prelude/global_lookup.carbon

@@ -0,0 +1,56 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+var x: {.v: ()} = {.v = ()};
+var y: {.v: ()} = x;
+
+// CHECK:STDOUT: --- global_lookup.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = struct_type {.v: ()} [template]
+// CHECK:STDOUT:   %.3: () = tuple_value () [template]
+// CHECK:STDOUT:   %.4: {.v: ()} = struct_value (%.3) [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .x = %x
+// CHECK:STDOUT:     .y = %y
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc7_14.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_14.2: type = converted %.loc7_14.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc7_15: type = struct_type {.v: ()} [template = constants.%.2]
+// CHECK:STDOUT:   %x.var: ref {.v: ()} = var x
+// CHECK:STDOUT:   %x: ref {.v: ()} = bind_name x, %x.var
+// CHECK:STDOUT:   %.loc8_14.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_14.2: type = converted %.loc8_14.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc8_15: type = struct_type {.v: ()} [template = constants.%.2]
+// CHECK:STDOUT:   %y.var: ref {.v: ()} = var y
+// CHECK:STDOUT:   %y: ref {.v: ()} = bind_name y, %y.var
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc7_26.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_27.1: {.v: ()} = struct_literal (%.loc7_26.1)
+// CHECK:STDOUT:   %.loc7_27.2: ref () = struct_access file.%x.var, element0
+// CHECK:STDOUT:   %.loc7_26.2: init () = tuple_init () to %.loc7_27.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc7_27.3: init () = converted %.loc7_26.1, %.loc7_26.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc7_27.4: init {.v: ()} = struct_init (%.loc7_27.3) to file.%x.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_28: init {.v: ()} = converted %.loc7_27.1, %.loc7_27.4 [template = constants.%.4]
+// CHECK:STDOUT:   assign file.%x.var, %.loc7_28
+// CHECK:STDOUT:   %x.ref: ref {.v: ()} = name_ref x, file.%x
+// CHECK:STDOUT:   %.loc8_19.1: ref () = struct_access %x.ref, element0
+// CHECK:STDOUT:   %.loc8_19.2: ref () = struct_access file.%y.var, element0
+// CHECK:STDOUT:   %.loc8_19.3: init () = tuple_init () to %.loc8_19.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc8_19.4: init () = converted %.loc8_19.1, %.loc8_19.3 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc8_19.5: init {.v: ()} = struct_init (%.loc8_19.4) to file.%y.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc8_20: init {.v: ()} = converted %x.ref, %.loc8_19.5 [template = constants.%.4]
+// CHECK:STDOUT:   assign file.%y.var, %.loc8_20
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 65 - 0
toolchain/check/testdata/var/no_prelude/global_lookup_in_scope.carbon

@@ -0,0 +1,65 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+var x: {.v: ()} = {.v = ()};
+
+fn Main() {
+  var y: {.v: ()} = x;
+}
+
+// CHECK:STDOUT: --- global_lookup_in_scope.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = struct_type {.v: ()} [template]
+// CHECK:STDOUT:   %.3: () = tuple_value () [template]
+// CHECK:STDOUT:   %.4: {.v: ()} = struct_value (%.3) [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .x = %x
+// CHECK:STDOUT:     .Main = %Main
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc7_14.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_14.2: type = converted %.loc7_14.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc7_15: type = struct_type {.v: ()} [template = constants.%.2]
+// CHECK:STDOUT:   %x.var: ref {.v: ()} = var x
+// CHECK:STDOUT:   %x: ref {.v: ()} = bind_name x, %x.var
+// CHECK:STDOUT:   %Main: <function> = fn_decl @Main [template] {}
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Main() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc10_16.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc10_16.2: type = converted %.loc10_16.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_17: type = struct_type {.v: ()} [template = constants.%.2]
+// CHECK:STDOUT:   %y.var: ref {.v: ()} = var y
+// CHECK:STDOUT:   %y: ref {.v: ()} = bind_name y, %y.var
+// CHECK:STDOUT:   %x.ref: ref {.v: ()} = name_ref x, file.%x
+// CHECK:STDOUT:   %.loc10_21.1: ref () = struct_access %x.ref, element0
+// CHECK:STDOUT:   %.loc10_21.2: ref () = struct_access %y.var, element0
+// CHECK:STDOUT:   %.loc10_21.3: init () = tuple_init () to %.loc10_21.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc10_21.4: init () = converted %.loc10_21.1, %.loc10_21.3 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc10_21.5: init {.v: ()} = struct_init (%.loc10_21.4) to %y.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc10_22: init {.v: ()} = converted %x.ref, %.loc10_21.5 [template = constants.%.4]
+// CHECK:STDOUT:   assign %y.var, %.loc10_22
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc7_26.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc7_27.1: {.v: ()} = struct_literal (%.loc7_26.1)
+// CHECK:STDOUT:   %.loc7_27.2: ref () = struct_access file.%x.var, element0
+// CHECK:STDOUT:   %.loc7_26.2: init () = tuple_init () to %.loc7_27.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc7_27.3: init () = converted %.loc7_26.1, %.loc7_26.2 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc7_27.4: init {.v: ()} = struct_init (%.loc7_27.3) to file.%x.var [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_28: init {.v: ()} = converted %.loc7_27.1, %.loc7_27.4 [template = constants.%.4]
+// CHECK:STDOUT:   assign file.%x.var, %.loc7_28
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 72 - 0
toolchain/check/testdata/var/no_prelude/import.carbon

@@ -0,0 +1,72 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// AUTOUPDATE
+
+// --- implicit.carbon
+
+package Implicit api;
+
+var a_ref: () = ();
+
+// --- implicit.impl.carbon
+
+package Implicit impl;
+
+var a: () = a_ref;
+
+// CHECK:STDOUT: --- implicit.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .a_ref = %a_ref
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc4_13.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc4_13.2: type = converted %.loc4_13.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %a_ref.var: ref () = var a_ref
+// CHECK:STDOUT:   %a_ref: ref () = bind_name a_ref, %a_ref.var
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %.loc4_18.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc4_18.2: init () = tuple_init () to file.%a_ref.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc4_19: init () = converted %.loc4_18.1, %.loc4_18.2 [template = constants.%.2]
+// CHECK:STDOUT:   assign file.%a_ref.var, %.loc4_19
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: --- implicit.impl.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   package: <namespace> = namespace [template] {
+// CHECK:STDOUT:     .a_ref = %import_ref
+// CHECK:STDOUT:     .a = %a
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %import_ref: ref () = import_ref ir0, inst+5, loc_11
+// CHECK:STDOUT:   %.loc4_9.1: () = tuple_literal ()
+// CHECK:STDOUT:   %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
+// CHECK:STDOUT:   %a.var: ref () = var a
+// CHECK:STDOUT:   %a: ref () = bind_name a, %a.var
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %a_ref.ref: ref () = name_ref a_ref, file.%import_ref
+// CHECK:STDOUT:   %.loc4_13: init () = tuple_init () to file.%a.var [template = constants.%.2]
+// CHECK:STDOUT:   %.loc4_18: init () = converted %a_ref.ref, %.loc4_13 [template = constants.%.2]
+// CHECK:STDOUT:   assign file.%a.var, %.loc4_18
+// CHECK:STDOUT:   return
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است