mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 19:58:11 +00:00
Change the names for emitted globals for constants with storage to include both the name of the constant and the name of the use. This causes the instructions to also be named in SemIR and in LLVM IR constants.
28 lines
1021 B
Plaintext
28 lines
1021 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
|
|
|
|
fn G(ab: ((i32, i32, i32), (i32, i32, i32)));
|
|
|
|
fn F(a: (i32, i32, i32), b: (i32, i32, i32)) {
|
|
G((a, b));
|
|
}
|
|
|
|
// CHECK:STDOUT: ; ModuleID = 'value_forwarding.carbon'
|
|
// CHECK:STDOUT: source_filename = "value_forwarding.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: declare void @G(ptr)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: define void @F(ptr %a, ptr %b) {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: %tuple = alloca { ptr, ptr }, align 8
|
|
// CHECK:STDOUT: %tuple1 = getelementptr inbounds { ptr, ptr }, ptr %tuple, i32 0, i32 0
|
|
// CHECK:STDOUT: store ptr %a, ptr %tuple1, align 8
|
|
// CHECK:STDOUT: %tuple2 = getelementptr inbounds { ptr, ptr }, ptr %tuple, i32 0, i32 1
|
|
// CHECK:STDOUT: store ptr %b, ptr %tuple2, align 8
|
|
// CHECK:STDOUT: call void @G(ptr %tuple)
|
|
// CHECK:STDOUT: ret void
|
|
// CHECK:STDOUT: }
|