00_Atomics.py 859 B

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