pinned_value_mutation_unread_data.carbon 445 B

12345678910111213141516171819202122
  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. package ExplorerTest api;
  7. fn Foo(n: i32) {
  8. Print("{0}", n);
  9. }
  10. fn Main() -> i32 {
  11. var v: {.a: i32, .b: i32} = {.a = 1, .b = 2};
  12. let a: i32 = v.a;
  13. v.b = 3;
  14. Foo(a);
  15. return 0;
  16. }
  17. // CHECK:STDOUT: 1
  18. // CHECK:STDOUT: result: 0