mod_edges.carbon 749 B

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