00_Atomics.py 835 B

123456789101112131415161718192021222324
  1. import os, sys, mmap
  2. from regression import Regression
  3. loader = os.environ['PAL_LOADER']
  4. is_sgx = 'SGX_RUN' in os.environ and os.environ['SGX_RUN'] == '1'
  5. success = True
  6. def manifest_file(file):
  7. if is_sgx:
  8. return file + '.manifest.sgx'
  9. else:
  10. return file + '.manifest'
  11. # Running AtomicMath
  12. regression = Regression(loader, "AtomicMath")
  13. regression.add_check(name="Atomic Math",
  14. check=lambda res: "Subtract INT_MIN: Both values match 2147483648" in res[0].log and \
  15. "Subtract INT_MAX: Both values match -2147483647" in res[0].log and \
  16. "Subtract LLONG_MIN: Both values match -9223372036854775808" in res[0].log and \
  17. "Subtract LLONG_MAX: Both values match -9223372036854775807" in res[0].log)
  18. rv = regression.run_checks()
  19. if rv: sys.exit(rv)