Commit | Line | Data |
---|---|---|
659b4611 | 1 | dnl check for gcc's "labels as values" feature |
515bc968 | 2 | AC_DEFUN([AC_C_LABELS_AS_VALUES], |
659b4611 AW |
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 | |
515bc968 | 18 | AC_DEFINE([HAVE_LABELS_AS_VALUES], [], |
659b4611 AW |
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 | ]) |