exhaustive_exponential_8x.carbon 1.2 KB

123456789101112131415161718192021222324252627282930
  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. choice AB {
  8. A(),
  9. B()
  10. }
  11. fn F() -> AB { return AB.A(); }
  12. fn Main() -> i32 {
  13. match ((F(), F(), F(), F(), F(), F(), F(), F())) {
  14. case (AB.A(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A()) => { return 0; }
  15. case (AB.B(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A()) => { return 1; }
  16. case (_: AB, AB.B(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A()) => { return 2; }
  17. case (_: AB, _: AB, AB.B(), AB.A(), AB.A(), AB.A(), AB.A(), AB.A()) => { return 3; }
  18. case (_: AB, _: AB, _: AB, AB.B(), AB.A(), AB.A(), AB.A(), AB.A()) => { return 4; }
  19. case (_: AB, _: AB, _: AB, _: AB, AB.B(), AB.A(), AB.A(), AB.A()) => { return 5; }
  20. case (_: AB, _: AB, _: AB, _: AB, _: AB, AB.B(), AB.A(), AB.A()) => { return 6; }
  21. case (_: AB, _: AB, _: AB, _: AB, _: AB, _: AB, AB.B(), AB.A()) => { return 7; }
  22. case (_: AB, _: AB, _: AB, _: AB, _: AB, _: AB, _: AB, AB.B()) => { return 8; }
  23. }
  24. }
  25. // CHECK:STDOUT: result: 0