labels-as-values.m4 605 B

1234567891011121314151617181920212223
  1. dnl check for gcc's "labels as values" feature
  2. AC_DEFUN([AC_C_LABELS_AS_VALUES],
  3. [AC_CACHE_CHECK([labels as values], ac_cv_labels_as_values,
  4. [AC_TRY_COMPILE([
  5. int foo(int);
  6. int foo(i)
  7. int i; {
  8. static void *label[] = { &&l1, &&l2 };
  9. goto *label[i];
  10. l1: return 1;
  11. l2: return 2;
  12. }
  13. ],
  14. [int i;],
  15. ac_cv_labels_as_values=yes,
  16. ac_cv_labels_as_values=no)])
  17. if test "$ac_cv_labels_as_values" = yes; then
  18. AC_DEFINE([HAVE_LABELS_AS_VALUES], [],
  19. [Define if compiler supports gcc's "labels as values" (aka computed goto)
  20. feature, used to speed up instruction dispatch in the interpreter.])
  21. fi
  22. ])