summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fshort-wchar.c
blob: c9c751504df5144beb906e5bdb017ce9007ade20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Copyright (C) 2002 Free Software Foundation, Inc.  */

/* { dg-do run } */
/* { dg-options "-fshort-wchar" } */
/* { dg-options "-fshort-wchar -Wl,--no-wchar-size-warning" { target arm*-*-*eabi } } */

/* Source: Neil Booth, 10 Dec 2002.

   Test that __WCHAR_MAX__ is correct with -fshort-wchar.  */

extern void abort (void);

int main ()
{
  __WCHAR_TYPE__ w = ~(__WCHAR_TYPE__) 0;

  if (w != __WCHAR_MAX__)
    abort ();
 
  return 0;
}