nested_tuple.carbon 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. var x: ((i32, i32), i32) = ((12, 76), 6);
  7. // CHECK:STDOUT: --- nested_tuple.carbon
  8. // CHECK:STDOUT:
  9. // CHECK:STDOUT: constants {
  10. // CHECK:STDOUT: %.loc7_18: type = tuple_type (type, type)
  11. // CHECK:STDOUT: %.loc7_24.1: type = tuple_type ((type, type), type)
  12. // CHECK:STDOUT: %.loc7_24.2: type = tuple_type (i32, i32)
  13. // CHECK:STDOUT: %.loc7_24.3: type = tuple_type ((i32, i32), i32)
  14. // CHECK:STDOUT: %.loc7_24.4: type = ptr_type (i32, i32)
  15. // CHECK:STDOUT: %.loc7_24.5: type = tuple_type ((i32, i32)*, i32)
  16. // CHECK:STDOUT: %.loc7_24.6: type = ptr_type ((i32, i32)*, i32)
  17. // CHECK:STDOUT: }
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: file {
  20. // CHECK:STDOUT: package: <namespace> = namespace {.x = %x}
  21. // CHECK:STDOUT: %.loc7_18: (type, type) = tuple_literal (i32, i32)
  22. // CHECK:STDOUT: %.loc7_24.1: ((type, type), type) = tuple_literal (%.loc7_18, i32)
  23. // CHECK:STDOUT: %.loc7_24.2: type = converted %.loc7_18, constants.%.loc7_24.2
  24. // CHECK:STDOUT: %.loc7_24.3: type = converted %.loc7_24.1, constants.%.loc7_24.3
  25. // CHECK:STDOUT: %x.var: ref ((i32, i32), i32) = var x
  26. // CHECK:STDOUT: %x: ref ((i32, i32), i32) = bind_name x, %x.var
  27. // CHECK:STDOUT: %.loc7_30: i32 = int_literal 12
  28. // CHECK:STDOUT: %.loc7_34: i32 = int_literal 76
  29. // CHECK:STDOUT: %.loc7_36.1: (i32, i32) = tuple_literal (%.loc7_30, %.loc7_34)
  30. // CHECK:STDOUT: %.loc7_39: i32 = int_literal 6
  31. // CHECK:STDOUT: %.loc7_40.1: ((i32, i32), i32) = tuple_literal (%.loc7_36.1, %.loc7_39)
  32. // CHECK:STDOUT: %.loc7_40.2: ref (i32, i32) = tuple_access %x.var, element0
  33. // CHECK:STDOUT: %.loc7_36.2: ref i32 = tuple_access %.loc7_40.2, element0
  34. // CHECK:STDOUT: %.loc7_36.3: init i32 = initialize_from %.loc7_30 to %.loc7_36.2
  35. // CHECK:STDOUT: %.loc7_36.4: ref i32 = tuple_access %.loc7_40.2, element1
  36. // CHECK:STDOUT: %.loc7_36.5: init i32 = initialize_from %.loc7_34 to %.loc7_36.4
  37. // CHECK:STDOUT: %.loc7_36.6: init (i32, i32) = tuple_init (%.loc7_36.3, %.loc7_36.5) to %.loc7_40.2
  38. // CHECK:STDOUT: %.loc7_36.7: init (i32, i32) = converted %.loc7_36.1, %.loc7_36.6
  39. // CHECK:STDOUT: %.loc7_40.3: ref i32 = tuple_access %x.var, element1
  40. // CHECK:STDOUT: %.loc7_40.4: init i32 = initialize_from %.loc7_39 to %.loc7_40.3
  41. // CHECK:STDOUT: %.loc7_40.5: init ((i32, i32), i32) = tuple_init (%.loc7_36.7, %.loc7_40.4) to %x.var
  42. // CHECK:STDOUT: %.loc7_40.6: init ((i32, i32), i32) = converted %.loc7_40.1, %.loc7_40.5
  43. // CHECK:STDOUT: assign %x.var, %.loc7_40.6
  44. // CHECK:STDOUT: }
  45. // CHECK:STDOUT: