File: reassoc-43.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 (56 lines) | stat: -rw-r--r-- 1,426 bytes parent folder | download
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
48
49
50
51
52
53
54
55
56
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-reassoc -w" } */

typedef union tree_node *tree;
enum cpp_ttype { CPP_COLON, CPP_SEMICOLON, CPP_CLOSE_BRACE, CPP_COMMA };
enum rid { RID_STATIC = 0, RID_ATTRIBUTE, };
typedef struct c_token
{
  enum cpp_ttype type:8;
}
c_token;
typedef struct c_parser
{
  c_token tokens[2];
  short tokens_avail;
}
c_parser;
int c_parser_next_token_is_keyword (c_parser *, enum rid);
tree chainon (int, tree);
int c_parser_attributes (c_parser *);
__inline__ c_token *
c_parser_peek_token (c_parser * parser)
{
  if (parser->tokens_avail == 0)
    {
      parser->tokens_avail = 1;
    }
  return &parser->tokens[0];
}

__inline__ unsigned char
c_parser_next_token_is (c_parser * parser, enum cpp_ttype type)
{
  return c_parser_peek_token (parser)->type == type;
}

void
c_parser_translation_unit (c_parser * parser)
{
  tree prefix_attrs;
  tree all_prefix_attrs;
  while (1)
    {
      if (c_parser_next_token_is (parser, CPP_COLON)
	  || c_parser_next_token_is (parser, CPP_COMMA)
	  || c_parser_next_token_is (parser, CPP_SEMICOLON)
	  || c_parser_next_token_is (parser, CPP_CLOSE_BRACE)
	  || c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE))
	{
	  if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE))
	    all_prefix_attrs =
	      chainon (c_parser_attributes (parser), prefix_attrs);
	}
    }
}
/* { dg-final { scan-tree-dump-not "\[ (\]0 != 0" "reassoc2"} } */