1 /* { dg-do compile } */
2 /* { dg-options "-w -fdump-rtl-expand" } */
3 /* { dg-skip-if "" { *-*-* } { } { "-O2" } } */
4
5 extern char errbuf[];
6 typedef struct Symbol
7 {
8 char *name;
9 }
10 Symbol;
11 typedef struct Tnode
12 {
13 }
14 Tnode;
15 typedef union Value
16 {
17 long long i;
18 }
19 Value;
20 typedef struct Entry
21 {
22 }
23 Entry;
24 typedef struct Table
25 {
26 }
27 Table;
28 typedef struct Node
29 {
30 Tnode *typ;
31 int sto;
32 Value val;
33 }
34 Node;
35 struct Scope
36 {
37 Table *table;
38 } *sp;
39 static Node op (Node);
40 Entry *p, *q;
41 union YYSTYPE
42 {
43 Symbol *sym;
44 Node rec;
45 };
46 typedef union YYSTYPE YYSTYPE;
47 typedef short int yytype_int16;
48
49 int
50 yyparse (void)
51 {
52 YYSTYPE yyval;
53 int yyn;
54 YYSTYPE *yyvsp;
55 while (1)
56 {
57 if (yyn == 34)
58 {
59 if ((yyvsp[-1].rec).sto & 0x10)
60 sprintf (errbuf, "invalid typedef qualifier for '%s'",
61 (yyvsp[0].sym)->name);
62 p = enter (sp->table, (yyvsp[0].sym));
63 }
64 else
65 op ((yyvsp[0].rec));
66 *++yyvsp = yyval;
67 }
68 }
69
70 static Node
71 op (Node q)
72 {
73 integer (q.typ);
74 mgtype (q.typ);
75 }
76
77
78 /* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:SI 5 \\\$5\\\)" 2 "expand" { target { ilp32 } } } } */
79 /* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:SI 6 \\\$6\\\)" 1 "expand" { target { ilp32 } } } } */
80
81 /* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:DI 5 \\\$5\\\)" 2 "expand" { target { lp64 } } } } */
82 /* { dg-final { scan-rtl-dump-times "\\\(set \\\(reg:DI 6 \\\$6\\\)" 1 "expand" { target { lp64 } } } } */