labels-as-values.m4 631 B

12345678910111213141516171819202122
  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_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  5. int foo(int);
  6. int foo(int i) {
  7. static void *label[] = { &&l1, &&l2 };
  8. goto *label[i];
  9. l1: return 1;
  10. l2: return 2;
  11. }
  12. ]],
  13. [[foo(1);]])],
  14. [ac_cv_labels_as_values=yes],
  15. [ac_cv_labels_as_values=no])])
  16. if test "$ac_cv_labels_as_values" = yes; then
  17. AC_DEFINE([HAVE_LABELS_AS_VALUES], [],
  18. [Define if compiler supports gcc's "labels as values" (aka computed goto)
  19. feature, used to speed up instruction dispatch in the interpreter.])
  20. fi
  21. ])