tuple.carbon 1.1 KB

12345678910111213141516171819202122232425262728
  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 Main() -> (i32, i32) {
  7. return (15, 35);
  8. }
  9. // CHECK:STDOUT: file "tuple.carbon" {
  10. // CHECK:STDOUT: %.loc8: type = ptr_type (i32, i32)
  11. // CHECK:STDOUT: %Main: <function> = fn_decl @Main
  12. // CHECK:STDOUT: }
  13. // CHECK:STDOUT:
  14. // CHECK:STDOUT: fn @Main() -> %return: (i32, i32) {
  15. // CHECK:STDOUT: !entry:
  16. // CHECK:STDOUT: %.loc9_11: i32 = int_literal 15
  17. // CHECK:STDOUT: %.loc9_15: i32 = int_literal 35
  18. // CHECK:STDOUT: %.loc9_17.1: (i32, i32) = tuple_literal (%.loc9_11, %.loc9_15)
  19. // CHECK:STDOUT: %.loc9_17.2: ref i32 = tuple_access %return, member0
  20. // CHECK:STDOUT: %.loc9_17.3: init i32 = initialize_from %.loc9_11 to %.loc9_17.2
  21. // CHECK:STDOUT: %.loc9_17.4: ref i32 = tuple_access %return, member1
  22. // CHECK:STDOUT: %.loc9_17.5: init i32 = initialize_from %.loc9_15 to %.loc9_17.4
  23. // CHECK:STDOUT: %.loc9_17.6: init (i32, i32) = tuple_init %.loc9_17.1, (%.loc9_17.3, %.loc9_17.5)
  24. // CHECK:STDOUT: return %.loc9_17.6
  25. // CHECK:STDOUT: }