1
0

main.c 654 B

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