tuple.carbon 1.4 KB

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