You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StrictFpCompile.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import org.aspectj.testing.*;
  2. public strictfp class StrictFpCompile {
  3. public static void main(String[] args) {
  4. new StrictFpCompile().go();
  5. Tester.check(ran, "go did not run");
  6. }
  7. static boolean ran = false;
  8. void go() {
  9. ran = true;
  10. }
  11. }
  12. // Ok, must be generated with strictfp modifier
  13. strictfp interface StrictInterface {
  14. // Has to be error, may not generate strictfp, but has to set strictfp in bytecode
  15. // strictfp float test1();
  16. // Ok, may not be generated with strictfp modifier
  17. float test2();
  18. };
  19. // Ok, must be generated with strictfp modifier
  20. strictfp abstract class StrictClass {
  21. // Has to be an error
  22. // strictfp float f;
  23. // Ok
  24. double d;
  25. // Has to be error, may not generate strictfp, but has to set strictfp in bytecode
  26. // strictfp StrictClass() {}
  27. // Ok, must not generate strictfp, but has to set strictfp in bytecode
  28. StrictClass(double _d) { d = _d; }
  29. // Ok, may be generated with strictfp modifier
  30. abstract float test1();
  31. // Ok, may be generated with strictfp modifier
  32. float test2() { return 0.f; }
  33. // Ok, may be generated with strictfp modifier
  34. strictfp float test3() { return 0.f; }
  35. // Ok, may be generated with strictfp modifier
  36. strictfp static float test4() { return 0.f; }
  37. };
  38. // Ok, may not be generated with strictfp modifier
  39. class NonStrictClass {
  40. // Ok
  41. NonStrictClass() {}
  42. // Ok, may not be generated with strictfp modifier
  43. float test2() { return 0.f; }
  44. // Ok, must be generated with strictfp modifier
  45. strictfp float test3() { return 0.f; }
  46. // Ok, must be generated with strictfp modifier
  47. strictfp static float test4() { return 0.f; }
  48. };
  49. // Ok
  50. strictfp class OuterStrictClass {
  51. // Ok, may be generated with strictfp modifier
  52. class InnerStrictClass {
  53. // Ok, may be generated with strictfp modifier
  54. class InnerInnerClass {
  55. }
  56. }
  57. };