nested_struct_in_place.carbon 1015 B

12345678910111213141516171819202122232425
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. fn F() -> (i32, i32, i32);
  7. fn G() {
  8. var v: {.a: (i32, i32, i32), .b: (i32, i32, i32)} = {.a = F(), .b = F()};
  9. }
  10. // CHECK:STDOUT: ; ModuleID = 'nested_struct_in_place.carbon'
  11. // CHECK:STDOUT: source_filename = "nested_struct_in_place.carbon"
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: declare void @F(ptr sret({ i32, i32, i32 }))
  14. // CHECK:STDOUT:
  15. // CHECK:STDOUT: define void @G() {
  16. // CHECK:STDOUT: %v = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8
  17. // CHECK:STDOUT: %a = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v, i32 0, i32 0
  18. // CHECK:STDOUT: call void @F(ptr %a)
  19. // CHECK:STDOUT: %b = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v, i32 0, i32 1
  20. // CHECK:STDOUT: call void @F(ptr %b)
  21. // CHECK:STDOUT: ret void
  22. // CHECK:STDOUT: }