00_Atomics.py 820 B

1234567891011121314151617181920212223
  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. def manifest_file(file):
  6. if is_sgx:
  7. return file + '.manifest.sgx'
  8. else:
  9. return file + '.manifest'
  10. # Running AtomicMath
  11. regression = Regression(loader, "AtomicMath")
  12. regression.add_check(name="Atomic Math",
  13. check=lambda res: "Subtract INT_MIN: Both values match 2147483648" in res[0].log and \
  14. "Subtract INT_MAX: Both values match -2147483647" in res[0].log and \
  15. "Subtract LLONG_MIN: Both values match -9223372036854775808" in res[0].log and \
  16. "Subtract LLONG_MAX: Both values match -9223372036854775807" in res[0].log)
  17. rv = regression.run_checks()
  18. if rv: sys.exit(rv)