main.cpp 529 B

12345678910111213141516171819202122
  1. extern "C" {
  2. extern int not3(int);
  3. extern int bytes(int);
  4. extern long long shr32(long long);
  5. extern double double5(void);
  6. }
  7. int main(int argc,char **argv)
  8. {
  9. if (not3(3)) return 100;
  10. /* on ppc32, gcc -mpowerpc64 produces SIGILL for >>32 */
  11. if (!not3(shr32(1))) return 100;
  12. /* on pentium 1, gcc -march=pentium2 produces SIGILL for (...+7)/8 */
  13. if (bytes(not3(1)) != 1) return 100;
  14. /* on pentium 1, gcc -march=prescott produces SIGILL for double comparison */
  15. if (double5() < 0) return 100;
  16. return 0;
  17. }