Files
carbon-lang/toolchain/check/testdata/class/redeclaration.carbon
T
Richard Smith 5665660677 Remove special-case formatting for class and interface LHS. (#3744)
These now have a type_id, so we can use the normal formatting.
2024-03-06 23:32:33 +00:00

58 lines
2.2 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
class Class;
class Class {
fn F[self: Self](b: bool);
}
fn Class.F[self: Self](b: bool) {}
// CHECK:STDOUT: --- redeclaration.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Class: type = class_type @Class [template]
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %.3: type = ptr_type {} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Class = %Class.decl.loc7
// CHECK:STDOUT: }
// CHECK:STDOUT: %Class.decl.loc7: type = class_decl @Class [template = constants.%Class] {}
// CHECK:STDOUT: %Class.decl.loc9: type = class_decl @Class [template = constants.%Class] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %self.loc13_12.1: Class = param self
// CHECK:STDOUT: @F.%self: Class = bind_name self, %self.loc13_12.1
// CHECK:STDOUT: %b.loc13_24.1: bool = param b
// CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc13_24.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class {
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %self.loc10_8.1: Class = param self
// CHECK:STDOUT: %self.loc10_8.2: Class = bind_name self, %self.loc10_8.1
// CHECK:STDOUT: %b.loc10_20.1: bool = param b
// CHECK:STDOUT: %b.loc10_20.2: bool = bind_name b, %b.loc10_20.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Class
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F[%self: Class](%b: bool) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: