File: pr13519-1.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (47 lines) | stat: -rw-r--r-- 1,543 bytes parent folder | download | duplicates (10)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* typeof applied to const+nonconst should be nonconst, as should
   typeof applied to other arithmetic expressions.  Bug 13519.  */
/* Origin: Debian bug report 208981
   from Kalle Olavi Niemitalo <kon@iki.fi>, adapted to a testcase by
   Joseph Myers <jsm@polyomino.org.uk>.  */
/* { dg-do compile } */
/* { dg-options "" } */

void fn(void)
{
  int n;
  const int c;

  { __typeof__(n) a1; a1=0; }
  { __typeof__(c) a2; a2=0; } /* { dg-error "read-only" "correct error" } */
  { __typeof__((int)n) a3; a3=0; }
  { __typeof__((int)c) a4; a4=0; } /* { dg-bogus "read-only" "bogus error" } */
  { __typeof__((const int)n) a5; a5=0; }
  { __typeof__((const int)c) a6; a6=0; }
  { __typeof__(0) a7; a7=0; }
  { __typeof__(1) a8; a8=0; }

  { __typeof__(n+n) b0; b0=0; }
  { __typeof__(n+c) b1; b1=0; }
  { __typeof__(c+n) b2; b2=0; }
  { __typeof__(c+c) b3; b3=0; }

  { __typeof__(0+n) c0; c0=0; }
  { __typeof__(0+c) c1; c1=0; }
  { __typeof__(n+0) c2; c2=0; }
  { __typeof__(c+0) c3; c3=0; }

  { __typeof__(1+n) d0; d0=0; }
  { __typeof__(1+c) d1; d1=0; }
  { __typeof__(n+1) d2; d2=0; }
  { __typeof__(c+1) d3; d3=0; }

  { __typeof__(((int)n)+((int)n)) e0; e0=0; }
  { __typeof__(((int)n)+((int)c)) e1; e1=0; }
  { __typeof__(((int)c)+((int)n)) e2; e2=0; }
  { __typeof__(((int)c)+((int)c)) e3; e3=0; }

  { __typeof__(((const int)n)+((const int)n)) f0; f0=0; }
  { __typeof__(((const int)n)+((const int)c)) f1; f1=0; }
  { __typeof__(((const int)c)+((const int)n)) f2; f2=0; }
  { __typeof__(((const int)c)+((const int)c)) f3; f3=0; }
}