gcc-goto.sh 495 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. # Test for gcc 'asm goto' support
  3. # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
  4. cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
  5. int main(void)
  6. {
  7. #if defined(__arm__) || defined(__aarch64__)
  8. /*
  9. * Not related to asm goto, but used by jump label
  10. * and broken on some ARM GCC versions (see GCC Bug 48637).
  11. */
  12. static struct { int dummy; int state; } tp;
  13. asm (".long %c0" :: "i" (&tp.state));
  14. #endif
  15. entry:
  16. asm goto ("" :::: entry);
  17. return 0;
  18. }
  19. END