| 123456789101112131415161718192021222324252627282930313233 |
- // 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
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/function/call/var_param.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/function/call/var_param.carbon
- fn DoNothing(a: i32) {}
- fn Main() {
- var a: i32 = 0;
- DoNothing(a);
- }
- // CHECK:STDOUT: ; ModuleID = 'var_param.carbon'
- // CHECK:STDOUT: source_filename = "var_param.carbon"
- // CHECK:STDOUT:
- // CHECK:STDOUT: define void @DoNothing(i32 %a) {
- // CHECK:STDOUT: entry:
- // CHECK:STDOUT: ret void
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: define void @Main() {
- // CHECK:STDOUT: entry:
- // CHECK:STDOUT: %a.var = alloca i32, align 4
- // CHECK:STDOUT: store i32 0, ptr %a.var, align 4
- // CHECK:STDOUT: %.loc15 = load i32, ptr %a.var, align 4
- // CHECK:STDOUT: call void @DoNothing(i32 %.loc15)
- // CHECK:STDOUT: ret void
- // CHECK:STDOUT: }
|