nested_tuple_in_place.carbon 1.0 KB

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: ((i32, i32, i32), (i32, i32, i32)) = (F(), F());
  9. }
  10. // CHECK:STDOUT: ; ModuleID = 'nested_tuple_in_place.carbon'
  11. // CHECK:STDOUT: source_filename = "nested_tuple_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: %tuple.elem = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v, i32 0, i32 0
  18. // CHECK:STDOUT: call void @F(ptr %tuple.elem)
  19. // CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v, i32 0, i32 1
  20. // CHECK:STDOUT: call void @F(ptr %tuple.elem1)
  21. // CHECK:STDOUT: ret void
  22. // CHECK:STDOUT: }