mod_edges.carbon 748 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. fn identFn( x: i32 ) -> i32{
  9. return x;
  10. }
  11. fn Main() -> i32 {
  12. var x : i32 = 7 % 2;
  13. if( x != 1){
  14. return 1;
  15. }
  16. x = (3*3) % 3;
  17. if( x != 0){
  18. return 2;
  19. }
  20. x = (4+4+4+4) % (2+1);
  21. if( x != 1){
  22. return 3;
  23. }
  24. x = 15 % (identFn(2)+1);
  25. if( x != 0){
  26. return 4;
  27. }
  28. x = -15 % 7;
  29. if( x != -1){
  30. return 5;
  31. }
  32. x = 15 % -7;
  33. if( x != 1){
  34. return 6;
  35. }
  36. x = -15 % -identFn(7);
  37. if( x != -1){
  38. return 7;
  39. }
  40. return 0;
  41. }