star.carbon 507 B

123456789101112131415161718192021
  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. // CHECK:STDOUT: result: 0
  7. package ExplorerTest api;
  8. // Never actually called, so this only tests typechecking and semantic analysis.
  9. fn F(n: i32, p: i32*, q: i32***) -> i32* {
  10. var a: i32 = n * *p;
  11. var b: i32 = a*n;
  12. *p = b*(*p);
  13. **q = p;
  14. return **q;
  15. }
  16. fn Main() -> i32 {
  17. return 0;
  18. }