| 12345678910111213141516171819202122232425262728293031 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- var a: (i32,) = (12,);
- var b: (i32,) = a;
- var c: i32 = b[0];
- // CHECK:STDOUT: file "tuple_element_access.carbon" {
- // CHECK:STDOUT: %.loc7_13.1: type = tuple_type (type)
- // CHECK:STDOUT: %.loc7_13.2: (type,) = tuple_literal (i32)
- // CHECK:STDOUT: %.loc7_13.3: type = tuple_type (i32)
- // CHECK:STDOUT: %a: ref (i32,) = var "a"
- // CHECK:STDOUT: %.loc7_18: i32 = int_literal 12
- // CHECK:STDOUT: %.loc7_21.1: (i32,) = tuple_literal (%.loc7_18)
- // CHECK:STDOUT: %.loc7_21.2: init (i32,) = tuple_init %.loc7_21.1, (%.loc7_18)
- // CHECK:STDOUT: assign %a, %.loc7_21.2
- // CHECK:STDOUT: %.loc8: (type,) = tuple_literal (i32)
- // CHECK:STDOUT: %b: ref (i32,) = var "b"
- // CHECK:STDOUT: %.loc7_5.1: ref i32 = tuple_access %a, member0
- // CHECK:STDOUT: %.loc7_5.2: i32 = bind_value %.loc7_5.1
- // CHECK:STDOUT: %.loc7_5.3: init (i32,) = tuple_init %a, (%.loc7_5.2)
- // CHECK:STDOUT: assign %b, %.loc7_5.3
- // CHECK:STDOUT: %c: ref i32 = var "c"
- // CHECK:STDOUT: %.loc9_16: i32 = int_literal 0
- // CHECK:STDOUT: %.loc9_17.1: ref i32 = tuple_index %b, %.loc9_16
- // CHECK:STDOUT: %.loc9_17.2: i32 = bind_value %.loc9_17.1
- // CHECK:STDOUT: assign %c, %.loc9_17.2
- // CHECK:STDOUT: }
|