OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [builtin-wctype-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Copyright (C) 2004, 2005  Free Software Foundation.
2
 
3
   Verify that built-in wctype function attributes are correctly set
4
   by the compiler.
5
 
6
   Written by Kaveh Ghazi, 2004-03-25.  */
7
 
8
/* { dg-do link } */
9
 
10
/* Use the target type definitions if we can.  */
11
#ifndef __WINT_TYPE__
12
#define __WINT_TYPE__ int
13
#endif
14
 
15
#ifndef __WCHAR_TYPE__
16
#define __WCHAR_TYPE__ int
17
#endif
18
 
19
void test(int i)
20
{
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()
28
 
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()
34
 
35
 
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__ */
52
}
53
 
54
int main (void)
55
{
56
  return 0;
57
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.