Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / torture / builtin-wctype-1.c
blob5b4371e1417c3314448c36182d4a94441cf52784
1 /* Copyright (C) 2004, 2005 Free Software Foundation.
3 Verify that built-in wctype function attributes are correctly set
4 by the compiler.
6 Written by Kaveh Ghazi, 2004-03-25. */
8 /* { dg-do link } */
10 /* Use the target type definitions if we can. */
11 #ifndef __WINT_TYPE__
12 #define __WINT_TYPE__ int
13 #endif
15 #ifndef __WCHAR_TYPE__
16 #define __WCHAR_TYPE__ int
17 #endif
19 void test(int i)
21 /* All of these ctype functions should be const/pure and thus
22 eliminated. */
23 #define TEST_IS_WCTYPE(FN) \
24 extern int FN(__WINT_TYPE__); \
25 extern void link_failure_##FN(void); \
26 if (FN(i) != FN(i)) \
27 link_failure_##FN()
29 #define TEST_TO_WCTYPE(FN) \
30 extern __WINT_TYPE__ FN(__WINT_TYPE__); \
31 extern void link_failure_##FN(void); \
32 if (FN(i) != FN(i)) \
33 link_failure_##FN()
36 #ifdef __OPTIMIZE__
37 TEST_IS_WCTYPE(iswalnum);
38 TEST_IS_WCTYPE(iswalpha);
39 TEST_IS_WCTYPE(iswblank);
40 TEST_IS_WCTYPE(iswcntrl);
41 TEST_IS_WCTYPE(iswdigit);
42 TEST_IS_WCTYPE(iswgraph);
43 TEST_IS_WCTYPE(iswlower);
44 TEST_IS_WCTYPE(iswprint);
45 TEST_IS_WCTYPE(iswpunct);
46 TEST_IS_WCTYPE(iswspace);
47 TEST_IS_WCTYPE(iswupper);
48 TEST_IS_WCTYPE(iswxdigit);
49 TEST_TO_WCTYPE(towlower);
50 TEST_TO_WCTYPE(towupper);
51 #endif /* __OPTIMIZE__ */
54 int main (void)
56 return 0;