mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Split apart some tests which don't need the prelude. (#3904)
This could probably go further, but I'm just trying to get the ability to run some significant tests without the prelude. This already requires some migration of `i32` and `bool` to non-prelude-dependent types (technically not at the moment, but I'm trying to stick with the philosophical model of the prelude). Note this undoes part of #3895 which had made all lex/parse tests depend on the prelude -- I don't think that was a necessary change. Rather, it seems better to isolate individual lex/parse tests from the prelude. I'd been on the fence in that PR (it was fixing one of the issues that contributed to wanting to not include the prelude), but now it feels more consistent. The prelude could have a parse error and we shouldn't break every parse test on that.
This commit is contained in:
@@ -1,142 +0,0 @@
|
||||
// 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
|
||||
|
||||
// --- basic.carbon
|
||||
|
||||
library "basic" api;
|
||||
|
||||
fn A();
|
||||
|
||||
// --- basic.impl.carbon
|
||||
|
||||
library "basic" impl;
|
||||
|
||||
fn A();
|
||||
|
||||
// --- extern_api.carbon
|
||||
|
||||
library "extern_api" api;
|
||||
|
||||
extern fn A();
|
||||
|
||||
// --- fail_extern_api.impl.carbon
|
||||
|
||||
library "extern_api" impl;
|
||||
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn A` in the same library must match use of `extern`.
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:1: In import.
|
||||
// CHECK:STDERR: library "extern_api" impl;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: extern_api.carbon:4:1: Previously declared here.
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
|
||||
// --- extern_impl.carbon
|
||||
|
||||
library "extern_impl" api;
|
||||
|
||||
fn A();
|
||||
|
||||
// --- fail_extern_impl.impl.carbon
|
||||
|
||||
library "extern_impl" impl;
|
||||
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+9]]:1: ERROR: Redeclarations of `fn A` in the same library must match use of `extern`.
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:1: In import.
|
||||
// CHECK:STDERR: library "extern_impl" impl;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: extern_impl.carbon:4:1: Previously declared here.
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
extern fn A();
|
||||
|
||||
// CHECK:STDOUT: --- basic.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = %Core
|
||||
// CHECK:STDOUT: .A = %A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- basic.impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = %Core
|
||||
// CHECK:STDOUT: .A = %A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- extern_api.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = %Core
|
||||
// CHECK:STDOUT: .A = %A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_extern_api.impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = %Core
|
||||
// CHECK:STDOUT: .A = %A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- extern_impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = %Core
|
||||
// CHECK:STDOUT: .A = %A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_extern_impl.impl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = %Core
|
||||
// CHECK:STDOUT: .A = %A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+2, loaded [template = imports.%A]
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
|
||||
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @A();
|
||||
// CHECK:STDOUT:
|
||||
Reference in New Issue
Block a user