@@ -64,17 +64,20 @@ import Cpp library "function.h";
64
64
alias FooShort = Cpp.foo_short;
65
65
alias FooInt = Cpp.foo_int;
66
66
67
- // --- todo_import_function_api.carbon
67
+ // --- fail_todo_import_function_api.carbon
68
+ // CHECK:STDERR: fail_todo_import_function_api.carbon: error: semantics TODO: `Unsupported: Importing C++ function `foo_short` indirectly` [SemanticsTodo]
69
+ // CHECK:STDERR:
70
+ // CHECK:STDERR: fail_todo_import_function_api.carbon: error: semantics TODO: `Unsupported: Importing C++ function `foo_int` indirectly` [SemanticsTodo]
71
+ // CHECK:STDERR:
68
72
69
73
library "[[@TEST_NAME]]" ;
70
74
71
75
import library "function_api" ;
72
76
73
- // TODO: Fix this test as a follow-up of https://github.com/carbon-language/carbon-lang/pull/5891.
74
77
fn F () {
75
78
// @dump-sem-ir-begin
76
- // FooShort(8 as i16);
77
- // FooInt(9);
79
+ FooShort (8 as i16 );
80
+ FooInt (9 );
78
81
// @dump-sem-ir-end
79
82
}
80
83
@@ -98,16 +101,51 @@ fn F() {
98
101
// CHECK:STDOUT: <elided>
99
102
// CHECK:STDOUT: }
100
103
// CHECK:STDOUT:
101
- // CHECK:STDOUT: --- todo_import_function_api .carbon
104
+ // CHECK:STDOUT: --- fail_todo_import_function_api .carbon
102
105
// CHECK:STDOUT:
103
106
// CHECK:STDOUT: constants {
107
+ // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
108
+ // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete]
109
+ // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete]
110
+ // CHECK:STDOUT: %As.type.771: type = facet_type <@As, @As(%i16)> [concrete]
111
+ // CHECK:STDOUT: %As.Convert.type.be5: type = fn_type @As.Convert, @As(%i16) [concrete]
112
+ // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
113
+ // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.565: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
114
+ // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
115
+ // CHECK:STDOUT: %As.impl_witness.2d2: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
116
+ // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.38a: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
117
+ // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.97a: %Core.IntLiteral.as.As.impl.Convert.type.38a = struct_value () [concrete]
118
+ // CHECK:STDOUT: %As.facet: %As.type.771 = facet_value Core.IntLiteral, (%As.impl_witness.2d2) [concrete]
119
+ // CHECK:STDOUT: %.026: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete]
120
+ // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.97a [concrete]
121
+ // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.97a, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete]
122
+ // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
123
+ // CHECK:STDOUT: %int_8.823: %i16 = int_value 8 [concrete]
124
+ // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete]
104
125
// CHECK:STDOUT: }
105
126
// CHECK:STDOUT:
106
127
// CHECK:STDOUT: imports {
128
+ // CHECK:STDOUT: %Main.FooShort: <error> = import_ref Main//function_api, FooShort, loaded [concrete = <error>]
129
+ // CHECK:STDOUT: %Main.FooInt: <error> = import_ref Main//function_api, FooInt, loaded [concrete = <error>]
130
+ // CHECK:STDOUT: %Core.import_ref.99c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.565) = import_ref Core//prelude/parts/int, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
131
+ // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
107
132
// CHECK:STDOUT: }
108
133
// CHECK:STDOUT:
109
134
// CHECK:STDOUT: fn @F() {
110
135
// CHECK:STDOUT: !entry:
136
+ // CHECK:STDOUT: %FooShort.ref: <error> = name_ref FooShort, imports.%Main.FooShort [concrete = <error>]
137
+ // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
138
+ // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
139
+ // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
140
+ // CHECK:STDOUT: %impl.elem0: %.026 = impl_witness_access constants.%As.impl_witness.2d2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.97a]
141
+ // CHECK:STDOUT: %bound_method.loc12_14.1: <bound method> = bound_method %int_8, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
142
+ // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
143
+ // CHECK:STDOUT: %bound_method.loc12_14.2: <bound method> = bound_method %int_8, %specific_fn [concrete = constants.%bound_method]
144
+ // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc12_14.2(%int_8) [concrete = constants.%int_8.823]
145
+ // CHECK:STDOUT: %.loc12_14.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.823]
146
+ // CHECK:STDOUT: %.loc12_14.2: %i16 = converted %int_8, %.loc12_14.1 [concrete = constants.%int_8.823]
147
+ // CHECK:STDOUT: %FooInt.ref: <error> = name_ref FooInt, imports.%Main.FooInt [concrete = <error>]
148
+ // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9]
111
149
// CHECK:STDOUT: <elided>
112
150
// CHECK:STDOUT: }
113
151
// CHECK:STDOUT:
0 commit comments