00_Atomics.py 829 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/python
  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. regression.run_checks()