Files
carbon-lang/toolchain/lowering/testdata/function/declaration/simple.carbon
T
Richard Smith 123662f5b1 Basic support for non-defining declarations of functions. (#2977)
This doesn't support redeclaration, so there's no way to provide a
definition in Carbon for a forward-declared function yet.
2023-07-07 01:08:02 +00:00

21 lines
644 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
// CHECK:STDOUT: ; ModuleID = 'simple.carbon'
// CHECK:STDOUT: source_filename = "simple.carbon"
// CHECK:STDOUT:
// CHECK:STDOUT: %EmptyTupleType = type {}
// CHECK:STDOUT:
// CHECK:STDOUT: declare %EmptyTupleType @F(i32)
// CHECK:STDOUT:
// CHECK:STDOUT: define %EmptyTupleType @G(i32 %n) {
// CHECK:STDOUT: %F = call %EmptyTupleType @F(i32 %n)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
fn F(n: i32);
fn G(n: i32) { F(n); }