mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 18:40:16 +01:00
I'd excluded these initially just because I was thinking towards copies, but under the current model I'm trying to catch all the decl types just for consistency. Note references will still be a TODO error (LazyImportRef is already tested for this, it just didn't feel necessary to add individual tests while I try to sort out behavior). Fixes an oversight where declarations in an entity's scope were being added to the list of exports. Note I'm trimming some Import API arguments as now-unused.
59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
// 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 Empty {
|
|
}
|
|
|
|
interface ForwardDeclared;
|
|
|
|
interface ForwardDeclared {
|
|
fn F();
|
|
}
|
|
|
|
// --- b.carbon
|
|
|
|
library "b" api;
|
|
|
|
import library "a";
|
|
|
|
// TODO: When ready, consider tests of basic import functionality.
|
|
|
|
// CHECK:STDOUT: --- a.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %Empty.decl, .ForwardDeclared = %ForwardDeclared.decl.loc7} [template]
|
|
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, ()
|
|
// CHECK:STDOUT: %ForwardDeclared.decl.loc7 = interface_decl @ForwardDeclared, ()
|
|
// CHECK:STDOUT: %ForwardDeclared.decl.loc9 = interface_decl @ForwardDeclared, ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @Empty {
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @ForwardDeclared {
|
|
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .F = %F
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F();
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- b.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %lazy_import_ref.1, .ForwardDeclared = %lazy_import_ref.2} [template]
|
|
// CHECK:STDOUT: %lazy_import_ref.1 = lazy_import_ref ir1, inst+1
|
|
// CHECK:STDOUT: %lazy_import_ref.2 = lazy_import_ref ir1, inst+2
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|