| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483 |
- // 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/full.carbon
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/primitives/import_symbolic.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/primitives/import_symbolic.carbon
- // --- bool.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! bool;
- }
- class C {
- impl as I where .val = false {}
- }
- // --- import_bool.carbon
- library "[[@TEST_NAME]]";
- import library "bool";
- fn F() -> bool {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // --- char.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! Core.Char;
- }
- class C {}
- impl C as I where .val = 'a' {}
- // --- import_char.carbon
- library "[[@TEST_NAME]]";
- import library "char";
- fn F() -> Core.Char {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // --- char_literal.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! Core.CharLiteral();
- }
- class C {}
- impl C as I where .val = 'a' {}
- // --- import_char_literal.carbon
- library "[[@TEST_NAME]]";
- import library "char_literal";
- fn F() -> Core.CharLiteral() {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // --- float.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! f64;
- }
- class C {}
- impl C as I where .val = 0.1 {}
- // --- import_float.carbon
- library "[[@TEST_NAME]]";
- import library "float";
- fn F() -> f64 {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // --- float_literal.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! Core.FloatLiteral();
- }
- class C {}
- impl C as I where .val = 0.1 {}
- // --- import_float_literal.carbon
- library "[[@TEST_NAME]]";
- import library "float_literal";
- fn F() -> Core.FloatLiteral() {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // --- int.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! i32;
- }
- class C {}
- impl C as I where .val = 8 {}
- // --- import_int.carbon
- library "[[@TEST_NAME]]";
- import library "int";
- fn F() -> i32 {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // --- int_literal.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! Core.IntLiteral();
- }
- class C {}
- impl C as I where .val = 7 {}
- // --- import_int_literal.carbon
- library "[[@TEST_NAME]]";
- import library "int_literal";
- fn F() -> Core.IntLiteral() {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // --- uint.carbon
- library "[[@TEST_NAME]]";
- interface I {
- let val:! u32;
- }
- class C {}
- impl C as I where .val = 8 {}
- // --- unsigned_uint.carbon
- library "[[@TEST_NAME]]";
- import library "uint";
- fn F() -> u32 {
- //@dump-sem-ir-begin
- return (C as I).val;
- //@dump-sem-ir-end
- }
- // CHECK:STDOUT: --- import_bool.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %false: bool = bool_literal false [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.030 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//bool, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//bool, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.8be: %I.assoc_type = import_ref Main//bool, loc5_10, loaded [concrete = constants.%assoc0]
- // CHECK:STDOUT: %Main.import_ref.d18: bool = import_ref Main//bool, loc9_32, loaded [concrete = constants.%false]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.d18), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.030: bool = import_ref Main//bool, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: bool = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> bool {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.8be [concrete = constants.%assoc0]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: bool = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%false]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_char.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Char: type = class_type @Char [concrete]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %int_97: %Char = int_value 97 [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0.941: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.8e8 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//char, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//char, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.da1: %I.assoc_type = import_ref Main//char, loc5_10, loaded [concrete = constants.%assoc0.941]
- // CHECK:STDOUT: %Main.import_ref.d0c: %Char = import_ref Main//char, loc10_30, loaded [concrete = constants.%int_97]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.d0c), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.8e8: %Char = import_ref Main//char, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: %Char = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> %Char {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.da1 [concrete = constants.%assoc0.941]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: %Char = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%int_97]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_char_literal.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %.54f: Core.CharLiteral = char_value U+0061 [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.dcc [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//char_literal, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//char_literal, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.696: %I.assoc_type = import_ref Main//char_literal, loc5_10, loaded [concrete = constants.%assoc0]
- // CHECK:STDOUT: %Main.import_ref.43e: Core.CharLiteral = import_ref Main//char_literal, loc10_30, loaded [concrete = constants.%.54f]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.43e), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.dcc: Core.CharLiteral = import_ref Main//char_literal, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: Core.CharLiteral = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> Core.CharLiteral {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.696 [concrete = constants.%assoc0]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: Core.CharLiteral = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%.54f]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_float.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
- // CHECK:STDOUT: %f64.d77: type = class_type @Float, @Float(%int_64) [concrete]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %float: %f64.d77 = float_value 0.10000000000000001 [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0.ece: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.267 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//float, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//float, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.de3: %I.assoc_type = import_ref Main//float, loc5_10, loaded [concrete = constants.%assoc0.ece]
- // CHECK:STDOUT: %Main.import_ref.0d9: %f64.d77 = import_ref Main//float, loc10_30, loaded [concrete = constants.%float]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.0d9), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.267: %f64.d77 = import_ref Main//float, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: %f64.d77 = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> %f64.d77 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.de3 [concrete = constants.%assoc0.ece]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: %f64.d77 = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%float]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_float_literal.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.e01 [concrete]
- // CHECK:STDOUT: %float.3fedf4.2: Core.FloatLiteral = float_literal_value 1e-1 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//float_literal, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//float_literal, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.730: %I.assoc_type = import_ref Main//float_literal, loc5_10, loaded [concrete = constants.%assoc0]
- // CHECK:STDOUT: %Main.import_ref.dec: Core.FloatLiteral = import_ref Main//float_literal, loc10_30, loaded [concrete = constants.%float.3fedf4.2]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.dec), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.e01: Core.FloatLiteral = import_ref Main//float_literal, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: Core.FloatLiteral = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> Core.FloatLiteral {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.730 [concrete = constants.%assoc0]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: Core.FloatLiteral = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%float.3fedf4.2]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_int.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %int_8: %i32 = int_value 8 [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0.aac: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.05e [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//int, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//int, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.ba4: %I.assoc_type = import_ref Main//int, loc5_10, loaded [concrete = constants.%assoc0.aac]
- // CHECK:STDOUT: %Main.import_ref.330: %i32 = import_ref Main//int, loc10_28, loaded [concrete = constants.%int_8]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.330), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.05e: %i32 = import_ref Main//int, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: %i32 = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> %i32 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.ba4 [concrete = constants.%assoc0.aac]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: %i32 = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%int_8]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_int_literal.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.d59 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//int_literal, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//int_literal, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.bc2: %I.assoc_type = import_ref Main//int_literal, loc5_10, loaded [concrete = constants.%assoc0]
- // CHECK:STDOUT: %Main.import_ref.bc3: Core.IntLiteral = import_ref Main//int_literal, loc10_28, loaded [concrete = constants.%int_7]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.bc3), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.d59: Core.IntLiteral = import_ref Main//int_literal, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: Core.IntLiteral = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> Core.IntLiteral {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.bc2 [concrete = constants.%assoc0]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: Core.IntLiteral = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%int_7]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- unsigned_uint.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
- // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
- // CHECK:STDOUT: %int_8: %u32 = int_value 8 [concrete]
- // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness imports.%I.impl_witness_table [concrete]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete]
- // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
- // CHECK:STDOUT: %assoc0.633: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.830 [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Main.I: type = import_ref Main//uint, I, loaded [concrete = constants.%I.type]
- // CHECK:STDOUT: %Main.C: type = import_ref Main//uint, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Main.import_ref.d18: %I.assoc_type = import_ref Main//uint, loc5_10, loaded [concrete = constants.%assoc0.633]
- // CHECK:STDOUT: %Main.import_ref.647: %u32 = import_ref Main//uint, loc10_28, loaded [concrete = constants.%int_8]
- // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%Main.import_ref.647), @C.as.I.impl [concrete]
- // CHECK:STDOUT: %Main.import_ref.830: %u32 = import_ref Main//uint, loc5_10, loaded [concrete = %val]
- // CHECK:STDOUT: %val: %u32 = assoc_const_decl @val [concrete] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> %u32 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
- // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
- // CHECK:STDOUT: %I.facet: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet]
- // CHECK:STDOUT: %.loc7_13: %I.type = converted %C.ref, %I.facet [concrete = constants.%I.facet]
- // CHECK:STDOUT: %val.ref: %I.assoc_type = name_ref val, imports.%Main.import_ref.d18 [concrete = constants.%assoc0.633]
- // CHECK:STDOUT: %as_type: type = facet_access_type %.loc7_13 [concrete = constants.%C]
- // CHECK:STDOUT: %.loc7_18: type = converted %.loc7_13, %as_type [concrete = constants.%C]
- // CHECK:STDOUT: %impl.elem0: %u32 = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%int_8]
- // CHECK:STDOUT: return %impl.elem0
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|