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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [digraphs.c] - Blame information for rev 307

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Copyright (C) 2000 Free Software Foundation, Inc.  */
2
 
3
/* { dg-do run } */
4
/* { dg-options "-std=c99" } */
5
 
6
/* Fully test the 6 digraphs under c99 assumptions.  Four are pasted,
7
   to check that digraph pasting works.  */
8
 
9
extern int strcmp (const char *, const char *);
10
extern void abort (void);
11
extern int puts (const char *);
12
#define err(str) do { puts(str); abort(); } while (0)
13
 
14
%:define glue(x, y) x %:%: y    /* #define glue(x, y) x ## y. */
15
#ifndef glue
16
#error glue not defined!
17
#endif
18
%:define str(x) %:x             /* #define str(x) #x */
19
 
20
int main (int argc, char *argv<::>) /* argv[] */
21
glue (<, %) /* { */
22
             /* di_str[] = */
23
  const char di_str glue(<, :)glue(:, >) = str(%:%:<::><%%>%:);
24
 
25
  /* Check the glue macro actually pastes, and that the spelling of
26
     all digraphs is preserved.  */
27
  if (glue(str, cmp) (di_str, "%:%:<::><%%>%:"))
28
    err ("Digraph spelling not preserved!");
29
 
30
  return 0;
31
glue (%, >) /* } */

powered by: WebSVN 2.1.0

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