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