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/] [trad/] [builtins.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test that builtin-macros are OK.  */
2
 
3
/* { dg-do run } */
4
 
5
#include "builtins.h"
6
 
7
void abort (void);
8
char *strstr (const char *, const char *);
9
int strcmp (const char *, const char *);
10
 
11
#define LINE __LINE__
12
 
13
#if __LINE__ != 13
14
# error __LINE__ part 1  /* { dg-bogus "__LINE__" } */
15
#endif
16
 
17
#if \
18
  __LINE__ != 18
19
# error __LINE__ part 2  /* { dg-bogus "__LINE__" } */
20
#endif
21
 
22
#if LINE != 22
23
# error __LINE__ part 3  /* { dg-bogus "__LINE__" } */
24
#endif
25
 
26
#if __INCLUDE_LEVEL != 0
27
# error __INCLUDE_LEVEL__  /* { dg-bogus "__INCLUDE_LEVEL__" } */
28
#endif
29
 
30
#if !defined (__TIME__)
31
# error __TIME__  /* { dg-bogus "__TIME__" } */
32
#endif
33
 
34
#if !defined (__DATE__)
35
# error __DATE__  /* { dg-bogus "__DATE__" } */
36
#endif
37
 
38
 
39
int main ()
40
{
41
  /* level is defined in builtins.h.  */
42
  if (level != 1)
43
    abort ();
44
 
45
  if (!strstr (__FILE__, "builtins.c"))
46
    abort ();
47
 
48
  if (!strcmp (__BASE_FILE__, "builtins.c"))
49
    abort ();
50
 
51
  return 0;
52
}

powered by: WebSVN 2.1.0

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