mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:51:04 +01:00
Merging CrossRef into ImportRefUsed, shifting builtins over. (#3659)
This is a bit of a cleanup; I probably should've just renamed CrossRef instead of adding ImportRefUsed. Adding `is_builtin` to InstId is more about providing a standard API for the check, which I expect to add a little more of. Shifts import tests to validate that the BuildValueRepr CHECK isn't accidentally hit.
This commit is contained in:
+13
-3
@@ -3,6 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: b.carbon: ERROR: Semantics TODO: `TODO: ResolveIfImportRefUnused for FunctionDecl`.
|
||||
|
||||
// --- a.carbon
|
||||
|
||||
@@ -16,7 +17,9 @@ library "b" api;
|
||||
|
||||
import library "a";
|
||||
|
||||
// TODO: When ready, consider tests of basic import functionality.
|
||||
fn Run() {
|
||||
F();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- a.carbon
|
||||
// CHECK:STDOUT:
|
||||
@@ -30,7 +33,14 @@ import library "a";
|
||||
// CHECK:STDOUT: --- b.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace {.F = %import_ref} [template]
|
||||
// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unused
|
||||
// CHECK:STDOUT: package: <namespace> = namespace {.F = %import_ref, .Run = %Run} [template]
|
||||
// CHECK:STDOUT: %import_ref: <error> = import_ref ir1, inst+1, used
|
||||
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: <error> = name_ref F, file.%import_ref
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
Reference in New Issue
Block a user