mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
As I was working on this, I noticed `import` and `library` syntax needs to be fixed for how it imports the current package, and for `Main` libraries. This mostly reflects the current state in its testing. Otherwise, this should handle most of the errors I could think of: dependency cycles, redundant imports, etc. It does not actually deal with the nuances of cross-IR references. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
30 lines
891 B
Plaintext
30 lines
891 B
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
|
|
|
|
// --- no_api.carbon
|
|
|
|
// CHECK:STDERR: no_api.carbon:[[@LINE+3]]:1: ERROR: Corresponding API not found.
|
|
// CHECK:STDERR: package Foo impl;
|
|
// CHECK:STDERR: ^
|
|
package Foo impl;
|
|
|
|
// --- no_api_lib.carbon
|
|
|
|
// CHECK:STDERR: no_api_lib.carbon:[[@LINE+3]]:1: ERROR: Corresponding API not found.
|
|
// CHECK:STDERR: package Foo library "Bar" impl;
|
|
// CHECK:STDERR: ^
|
|
package Foo library "Bar" impl;
|
|
|
|
// CHECK:STDOUT: file "no_api.carbon" {
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %.1: type = ptr_type String
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file "no_api_lib.carbon" {
|
|
// CHECK:STDOUT: %.loc5: String = string_literal "Bar"
|
|
// CHECK:STDOUT: }
|