aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/dwarf2/pr82837.c
blob: 743fb28ca41de55c5fd89fc93d4c1dc44d9cafd9 (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
/* PR debug/82837 */
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
/* { dg-additional-options "-march=athlon" { target ia32 } } */
/* { dg-additional-options "-fPIE" { target pie } } */

static char b[100];
static int *c;
char *e;
void a(char *f, char *i) {
  int d = __builtin_object_size(f, 1);
  __builtin___strcpy_chk(f, i, d);
}
void g(void) {
  int h;
  switch (*c) {
  case 8:
    e = "swapgs";
    break;
  case 9:
    e = "rdtscp";
    break;
  default:
    return;
  }
  h = __builtin_strlen(b);
  a(b + h - 6, e);
  c++;
}