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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [charconst.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Copyright (C) 2001 Free Software Foundation, Inc.  */
2
 
3
/* { dg-do compile } */
4
 
5
/* This tests various diagnostics about character constants, for both
6
   the preprocessor and the compiler.
7
 
8
   Neil Booth, 22 May 2001.  */
9
 
10
#if ''                  /* { dg-warning "empty" "empty charconst" } */
11
#endif
12
#if L''                 /* { dg-warning "empty" "empty wide charconst" } */
13
#endif
14
#if 'very long'         /* { dg-warning "too long" "long charconst" } */
15
#endif
16
#if L'very long'        /* { dg-warning "too long" "long wide charconst" } */
17
#endif
18
/* Don't do this test for L'ab'; it depends upon sizeof (wchar_t).  */
19
#if 'ab'                /* { dg-warning "multi-char" "multi-character" } */
20
#endif
21
 
22
void foo ()
23
{
24
  int c;
25
  __WCHAR_TYPE__ w;
26
 
27
  c = '';               /* { dg-warning "empty" "empty charconst" } */
28
  w = L'';              /* { dg-warning "empty" "empty wide charconst" } */
29
 
30
  c = 'very long';      /* { dg-warning "too long" "long charconst" } */
31
  w = L'very long';     /* { dg-warning "too long" "long wide charconst" } */
32
 
33
  c = 'ab';             /* { dg-warning "multi-char" "multi-char" } */
34
  /* Wide charconsts cannot contain more than one wide character.  */
35
  w = L'ab';            /* { dg-warning "too long" "multi-char wide" } */
36
}

powered by: WebSVN 2.1.0

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