array_in_place.carbon 958 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: [(i32, i32, i32); 2] = (F(), F());
  9. }
  10. // CHECK:STDOUT: ; ModuleID = 'array_in_place.carbon'
  11. // CHECK:STDOUT: source_filename = "array_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 [2 x { i32, i32, i32 }], align 8
  17. // CHECK:STDOUT: %array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v, i32 0, i32 0
  18. // CHECK:STDOUT: call void @F(ptr %array.index)
  19. // CHECK:STDOUT: %array.index1 = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v, i32 0, i32 1
  20. // CHECK:STDOUT: call void @F(ptr %array.index1)
  21. // CHECK:STDOUT: ret void
  22. // CHECK:STDOUT: }