mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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.
58 lines
2.3 KiB
Plaintext
58 lines
2.3 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
|
|
|
|
interface Empty {
|
|
}
|
|
|
|
interface ForwardDeclared;
|
|
|
|
interface ForwardDeclared {
|
|
fn F();
|
|
}
|
|
|
|
// CHECK:STDOUT: --- basic.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %.1: type = interface_type @Empty [template]
|
|
// CHECK:STDOUT: %Self.1: Empty = bind_symbolic_name Self 0 [symbolic]
|
|
// CHECK:STDOUT: %.2: type = interface_type @ForwardDeclared [template]
|
|
// CHECK:STDOUT: %Self.2: ForwardDeclared = bind_symbolic_name Self 0 [symbolic]
|
|
// CHECK:STDOUT: %.3: type = assoc_entity_type @ForwardDeclared, <function> [template]
|
|
// CHECK:STDOUT: %.4: <associated <function> in ForwardDeclared> = assoc_entity element0, @ForwardDeclared.%F [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Empty = %Empty.decl
|
|
// CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc10
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {}
|
|
// CHECK:STDOUT: %ForwardDeclared.decl.loc10: type = interface_decl @ForwardDeclared [template = constants.%.2] {}
|
|
// CHECK:STDOUT: %ForwardDeclared.decl.loc12: type = interface_decl @ForwardDeclared [template = constants.%.2] {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @Empty {
|
|
// CHECK:STDOUT: %Self: Empty = bind_symbolic_name Self 0 [symbolic = constants.%Self.1]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @ForwardDeclared {
|
|
// CHECK:STDOUT: %Self: ForwardDeclared = bind_symbolic_name Self 0 [symbolic = constants.%Self.2]
|
|
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
|
|
// CHECK:STDOUT: %.loc13: <associated <function> in ForwardDeclared> = assoc_entity element0, %F [template = constants.%.4]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: .F = %.loc13
|
|
// CHECK:STDOUT: witness = (%F)
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F();
|
|
// CHECK:STDOUT:
|