summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/20000625-2.c
blob: fb458984b8c0ce03233eba86ce82fd12ca7f95b2 (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
/* 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

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;
}