| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- // 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 {
- fn F() -> i32;
- fn G() -> i32;
- }
- fn Class.F() -> i32 {
- Self.G();
- return G();
- }
- // CHECK:STDOUT: --- reenter_scope.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Class: type = class_type @Class [template]
- // CHECK:STDOUT: %F: type = fn_type @F [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %struct.1: F = struct_value () [template]
- // CHECK:STDOUT: %G: type = fn_type @G [template]
- // CHECK:STDOUT: %struct.2: G = struct_value () [template]
- // CHECK:STDOUT: %.2: type = struct_type {} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = %Core
- // CHECK:STDOUT: .Class = %Class.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
- // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {}
- // CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {
- // CHECK:STDOUT: @F.%return: ref i32 = var <return slot>
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Class {
- // CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {
- // CHECK:STDOUT: %return.var.loc8: ref i32 = var <return slot>
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.2] {
- // CHECK:STDOUT: %return.var.loc9: ref i32 = var <return slot>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Class
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: .G = %G.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() -> i32 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class]
- // CHECK:STDOUT: %G.ref.loc13: G = name_ref G, @Class.%G.decl [template = constants.%struct.2]
- // CHECK:STDOUT: %G.call.loc13: init i32 = call %G.ref.loc13()
- // CHECK:STDOUT: %G.ref.loc14: G = name_ref G, @Class.%G.decl [template = constants.%struct.2]
- // CHECK:STDOUT: %G.call.loc14: init i32 = call %G.ref.loc14()
- // CHECK:STDOUT: %.loc14_13.1: i32 = value_of_initializer %G.call.loc14
- // CHECK:STDOUT: %.loc14_13.2: i32 = converted %G.call.loc14, %.loc14_13.1
- // CHECK:STDOUT: return %.loc14_13.2
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @G() -> i32;
- // CHECK:STDOUT:
|