assign_var.carbon 1.6 KB

1234567891011121314151617181920212223242526272829303132
  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 a: (i32, i32, i32) = (1, 2, 3);
  7. var b: [i32; 3] = a;
  8. // CHECK:STDOUT: file "assign_var.carbon" {
  9. // CHECK:STDOUT: %.loc7_9: type = stub_reference i32
  10. // CHECK:STDOUT: %.loc7_14: type = stub_reference i32
  11. // CHECK:STDOUT: %.loc7_19: type = stub_reference i32
  12. // CHECK:STDOUT: %.loc7_22.1: type = tuple_type (type, type, type)
  13. // CHECK:STDOUT: %.loc7_22.2: (type, type, type) = tuple_literal (%.loc7_9, %.loc7_14, %.loc7_19)
  14. // CHECK:STDOUT: %.loc7_22.3: type = tuple_type (i32, i32, i32)
  15. // CHECK:STDOUT: %a: ref (i32, i32, i32) = var "a"
  16. // CHECK:STDOUT: %.loc7_27.1: i32 = int_literal 1
  17. // CHECK:STDOUT: %.loc7_27.2: i32 = stub_reference %.loc7_27.1
  18. // CHECK:STDOUT: %.loc7_30.1: i32 = int_literal 2
  19. // CHECK:STDOUT: %.loc7_30.2: i32 = stub_reference %.loc7_30.1
  20. // CHECK:STDOUT: %.loc7_33.1: i32 = int_literal 3
  21. // CHECK:STDOUT: %.loc7_33.2: i32 = stub_reference %.loc7_33.1
  22. // CHECK:STDOUT: %.loc7_34: (i32, i32, i32) = tuple_literal (%.loc7_27.2, %.loc7_30.2, %.loc7_33.2)
  23. // CHECK:STDOUT: assign %a, %.loc7_34
  24. // CHECK:STDOUT: %.loc8_14: i32 = int_literal 3
  25. // CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, i32
  26. // CHECK:STDOUT: %b: ref [i32; 3] = var "b"
  27. // CHECK:STDOUT: %.loc7_5.1: (i32, i32, i32) = bind_value %a
  28. // CHECK:STDOUT: %.loc7_5.2: [i32; 3] = array_value %.loc7_5.1
  29. // CHECK:STDOUT: assign %b, %.loc7_5.2
  30. // CHECK:STDOUT: }