aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/20000625-2.c
blob: c9e3fe23b9c96953104738a390a0b59b6b18b8cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* More paste corner cases from glibc.  */
/* { dg-do run } */

#include <stdlib.h>
#include <string.h>

#define symbol_version(name, version) name##@##version
#define str(x) xstr(x)
#define xstr(x) #x

/* This testcase is bogus, as it testing undefined behaviour.  We can
   get the behaviour GLIBC desires by removing the space before
   GCLIB_2.0 in this line.  */
const char a[] = str(symbol_version(getrlimit,GLIBC_2.0));
/* { dg-warning "valid preprocessing token" "" { target *-*-* } 11 } */
const char b[] = str(getrlimit@GLIBC_2.0);
const char c[] = "getrlimit@GLIBC_2.0";

int
main(void)
{
  if(strcmp(a, b))
    abort();
  if(strcmp(b, c))
    abort();
  if(strcmp(c, a))
    abort();

  return 0;
}