mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-26 22:02:30 +01:00
For now, we treat class types and `String` as non-copyable, because we don't know how to emit SemIR to copy them yet. This will change as we add support for copying those types when appropriate. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
30 lines
744 B
Plaintext
30 lines
744 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
|
|
|
|
class C {
|
|
var a: i32;
|
|
var b: C*;
|
|
}
|
|
|
|
fn F(c: C) -> C;
|
|
|
|
fn Run() {
|
|
var c: C;
|
|
var d: C = F(c);
|
|
}
|
|
|
|
// CHECK:STDOUT: ; ModuleID = 'basic.carbon'
|
|
// CHECK:STDOUT: source_filename = "basic.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: declare void @F(ptr sret({ i32, ptr }), ptr)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: define void @main() {
|
|
// CHECK:STDOUT: %c = alloca { i32, ptr }, align 8
|
|
// CHECK:STDOUT: %d = alloca { i32, ptr }, align 8
|
|
// CHECK:STDOUT: call void @F(ptr %d, ptr %c)
|
|
// CHECK:STDOUT: ret void
|
|
// CHECK:STDOUT: }
|