| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399 |
- // 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
- //
- // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
- // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
- // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/missing_prelude.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/missing_prelude.carbon
- // --- fail_missing_prelude.carbon
- library "[[@TEST_NAME]]";
- // CHECK:STDERR: fail_missing_prelude.carbon:[[@LINE+4]]:8: error: `Core.Int` implicitly referenced here, but package `Core` not found [CoreNotFound]
- // CHECK:STDERR: var n: i32;
- // CHECK:STDERR: ^~~
- // CHECK:STDERR:
- var n: i32;
- // --- prelude_empty.carbon
- package Core library "[[@TEST_NAME]]";
- // --- fail_missing_prelude_member.carbon
- library "[[@TEST_NAME]]";
- import Core library "prelude_empty";
- // CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: error: name `Core.Int` implicitly referenced here, but not found [CoreNameNotFound]
- // CHECK:STDERR: var n: i32;
- // CHECK:STDERR: ^~~
- // CHECK:STDERR:
- var n: i32;
- // --- prelude_fake_int.carbon
- package Core library "[[@TEST_NAME]]";
- fn Int[T:! type](N:! T) -> {} { return {}; }
- // --- use_fake_int.carbon
- library "[[@TEST_NAME]]";
- import Core library "prelude_fake_int";
- var n: {} = i32;
- // --- prelude_use_in_prelude.carbon
- package Core library "[[@TEST_NAME]]";
- // Core is not an imported package here.
- // Note that we are intentionally using a different type here from other cases
- // to test that this function is called, not the one from prelude_fake_int.
- fn Int[T:! type](N:! T) -> () { return (); }
- var n: () = i32;
- // --- fail_prelude_as_namespace.carbon
- library "[[@TEST_NAME]]";
- // CHECK:STDERR: fail_prelude_as_namespace.carbon:[[@LINE+8]]:11: error: `namespace` introducer should be followed by a name [ExpectedDeclName]
- // CHECK:STDERR: namespace Core;
- // CHECK:STDERR: ^~~~
- // CHECK:STDERR:
- // CHECK:STDERR: fail_prelude_as_namespace.carbon:[[@LINE+4]]:11: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
- // CHECK:STDERR: namespace Core;
- // CHECK:STDERR: ^~~~
- // CHECK:STDERR:
- namespace Core;
- // CHECK:STDERR: fail_prelude_as_namespace.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName]
- // CHECK:STDERR: fn Core.Int[T:! type](N:! T) -> {} { return {}; }
- // CHECK:STDERR: ^~~~
- // CHECK:STDERR:
- fn Core.Int[T:! type](N:! T) -> {} { return {}; }
- var n: {} = i32;
- // --- fail_prelude_as_class.carbon
- library "[[@TEST_NAME]]";
- // CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+8]]:7: error: `class` introducer should be followed by a name [ExpectedDeclName]
- // CHECK:STDERR: class Core {
- // CHECK:STDERR: ^~~~
- // CHECK:STDERR:
- // CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+4]]:7: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
- // CHECK:STDERR: class Core {
- // CHECK:STDERR: ^~~~
- // CHECK:STDERR:
- class Core {
- fn Int[T:! type](N:! T) -> {} { return {}; }
- }
- var n: {} = i32;
- // CHECK:STDOUT: --- fail_missing_prelude.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .n = %n
- // CHECK:STDOUT: }
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %n.patt: <error> = ref_binding_pattern n [concrete]
- // CHECK:STDOUT: %n.var_patt: <error> = var_pattern %n.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %n.var: ref <error> = var %n.var_patt [concrete = <error>]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
- // CHECK:STDOUT: %n: ref <error> = ref_binding n, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- prelude_empty.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_missing_prelude_member.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
- // CHECK:STDOUT: .Int = <poisoned>
- // CHECK:STDOUT: import Core//prelude_empty
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .n = %n
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %n.patt: <error> = ref_binding_pattern n [concrete]
- // CHECK:STDOUT: %n.var_patt: <error> = var_pattern %n.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %n.var: ref <error> = var %n.var_patt [concrete = <error>]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
- // CHECK:STDOUT: %n: ref <error> = ref_binding n, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- prelude_fake_int.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
- // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
- // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
- // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
- // CHECK:STDOUT: %N: %T = symbolic_binding N, 1 [symbolic]
- // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
- // CHECK:STDOUT: %.e6e: form = init_form %empty_struct_type, call_param0 [concrete]
- // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
- // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
- // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Int = %Int.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
- // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
- // CHECK:STDOUT: %N.patt: @Int.%pattern_type (%pattern_type.51d) = symbolic_binding_pattern N, 1 [concrete]
- // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete]
- // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param0 [concrete]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %.loc4_29.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
- // CHECK:STDOUT: %.loc4_29.2: type = converted %.loc4_29.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
- // CHECK:STDOUT: %.loc4_29.3: form = init_form %.loc4_29.2, call_param0 [concrete = constants.%.e6e]
- // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
- // CHECK:STDOUT: %T.loc4_8.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_8.1 (constants.%T)]
- // CHECK:STDOUT: %.loc4_22: type = splice_block %T.ref [symbolic = %T.loc4_8.1 (constants.%T)] {
- // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
- // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_8.2 [symbolic = %T.loc4_8.1 (constants.%T)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %N.loc4_18.2: @Int.%T.loc4_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc4_18.1 (constants.%N)]
- // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
- // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Int(%T.loc4_8.2: type, %N.loc4_18.2: @Int.%T.loc4_8.1 (%T)) {
- // CHECK:STDOUT: %T.loc4_8.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_8.1 (constants.%T)]
- // CHECK:STDOUT: %N.loc4_18.1: @Int.%T.loc4_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc4_18.1 (constants.%N)]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_8.1 [symbolic = %pattern_type (constants.%pattern_type.51d)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn() -> %empty_struct_type {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc4_41.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
- // CHECK:STDOUT: %.loc4_41.2: init %empty_struct_type = struct_init () to %return.param [concrete = constants.%empty_struct]
- // CHECK:STDOUT: %.loc4_42: init %empty_struct_type = converted %.loc4_41.1, %.loc4_41.2 [concrete = constants.%empty_struct]
- // CHECK:STDOUT: return %.loc4_42 to %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) {
- // CHECK:STDOUT: %T.loc4_8.1 => constants.%T
- // CHECK:STDOUT: %N.loc4_18.1 => constants.%N
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_fake_int.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
- // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
- // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
- // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
- // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
- // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
- // CHECK:STDOUT: %N: %T = symbolic_binding N, 1 [symbolic]
- // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
- // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function %Int, @Int(Core.IntLiteral, %int_32) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
- // CHECK:STDOUT: .Int = %Core.Int
- // CHECK:STDOUT: import Core//prelude_fake_int
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude_fake_int, Int, loaded [concrete = constants.%Int]
- // CHECK:STDOUT: %Core.import_ref.b3b: type = import_ref Core//prelude_fake_int, loc{{\d+_\d+}}, loaded [symbolic = @Int.%T (constants.%T)]
- // CHECK:STDOUT: %Core.import_ref.b42: @Int.%T (%T) = import_ref Core//prelude_fake_int, loc{{\d+_\d+}}, loaded [symbolic = @Int.%N (constants.%N)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .n = %n
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %n.patt: %pattern_type.a96 = ref_binding_pattern n [concrete]
- // CHECK:STDOUT: %n.var_patt: %pattern_type.a96 = var_pattern %n.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %n.var: ref %empty_struct_type = var %n.var_patt [concrete]
- // CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_struct_type] {
- // CHECK:STDOUT: %.loc6_9.2: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
- // CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %n: ref %empty_struct_type = ref_binding n, %n.var [concrete = %n.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Int(imports.%Core.import_ref.b3b: type, imports.%Core.import_ref.b42: @Int.%T (%T)) [from "prelude_fake_int.carbon"] {
- // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
- // CHECK:STDOUT: %N: @Int.%T (%T) = symbolic_binding N, 1 [symbolic = %N (constants.%N)]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.51d)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn;
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
- // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%int_32) [concrete = constants.%Int.specific_fn]
- // CHECK:STDOUT: %Int.call: init %empty_struct_type = call %Int.specific_fn()
- // CHECK:STDOUT: assign file.%n.var, %Int.call
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) {
- // CHECK:STDOUT: %T => constants.%T
- // CHECK:STDOUT: %N => constants.%N
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%int_32) {
- // CHECK:STDOUT: %T => Core.IntLiteral
- // CHECK:STDOUT: %N => constants.%int_32
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc0
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- prelude_use_in_prelude.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
- // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
- // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
- // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
- // CHECK:STDOUT: %N: %T = symbolic_binding N, 1 [symbolic]
- // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %.62c: form = init_form %empty_tuple.type, call_param0 [concrete]
- // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
- // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
- // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
- // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
- // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function %Int, @Int(Core.IntLiteral, %int_32) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Int = %Int.decl
- // CHECK:STDOUT: .n = %n
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
- // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
- // CHECK:STDOUT: %N.patt: @Int.%pattern_type (%pattern_type.51d) = symbolic_binding_pattern N, 1 [concrete]
- // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete]
- // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param0 [concrete]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %.loc8_29.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc8_29.2: type = converted %.loc8_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
- // CHECK:STDOUT: %.loc8_29.3: form = init_form %.loc8_29.2, call_param0 [concrete = constants.%.62c]
- // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
- // CHECK:STDOUT: %T.loc8_8.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_8.1 (constants.%T)]
- // CHECK:STDOUT: %.loc8_22: type = splice_block %T.ref [symbolic = %T.loc8_8.1 (constants.%T)] {
- // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
- // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_8.2 [symbolic = %T.loc8_8.1 (constants.%T)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %N.loc8_18.2: @Int.%T.loc8_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc8_18.1 (constants.%N)]
- // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
- // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %n.patt: %pattern_type.cb1 = ref_binding_pattern n [concrete]
- // CHECK:STDOUT: %n.var_patt: %pattern_type.cb1 = var_pattern %n.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %n.var: ref %empty_tuple.type = var %n.var_patt [concrete]
- // CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
- // CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %n: ref %empty_tuple.type = ref_binding n, %n.var [concrete = %n.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Int(%T.loc8_8.2: type, %N.loc8_18.2: @Int.%T.loc8_8.1 (%T)) {
- // CHECK:STDOUT: %T.loc8_8.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_8.1 (constants.%T)]
- // CHECK:STDOUT: %N.loc8_18.1: @Int.%T.loc8_8.1 (%T) = symbolic_binding N, 1 [symbolic = %N.loc8_18.1 (constants.%N)]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc8_8.1 [symbolic = %pattern_type (constants.%pattern_type.51d)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn() -> %empty_tuple.type {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc8_41.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc8_41.2: init %empty_tuple.type = tuple_init () to %return.param [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc8_42: init %empty_tuple.type = converted %.loc8_41.1, %.loc8_41.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: return %.loc8_42 to %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
- // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%int_32) [concrete = constants.%Int.specific_fn]
- // CHECK:STDOUT: %Int.call: init %empty_tuple.type = call %Int.specific_fn()
- // CHECK:STDOUT: assign file.%n.var, %Int.call
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) {
- // CHECK:STDOUT: %T.loc8_8.1 => constants.%T
- // CHECK:STDOUT: %N.loc8_18.1 => constants.%N
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%int_32) {
- // CHECK:STDOUT: %T.loc8_8.1 => Core.IntLiteral
- // CHECK:STDOUT: %N.loc8_18.1 => constants.%int_32
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc0
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_prelude_as_namespace.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_prelude_as_class.carbon
- // CHECK:STDOUT:
|