OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [builtin-fprintf-chk-1.c] - Blame information for rev 816

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-fab" } */
3
 
4
typedef struct { int i; } FILE;
5
FILE *fp;
6
extern int __fprintf_chk (FILE *, int, const char *, ...);
7
volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9;
8
 
9
void test (void)
10
{
11
  vi0 = 0;
12
  __fprintf_chk (fp, 1, "hello");
13
  vi1 = 0;
14
  __fprintf_chk (fp, 1, "hello\n");
15
  vi2 = 0;
16
  __fprintf_chk (fp, 1, "a");
17
  vi3 = 0;
18
  __fprintf_chk (fp, 1, "");
19
  vi4 = 0;
20
  __fprintf_chk (fp, 1, "%s", "hello");
21
  vi5 = 0;
22
  __fprintf_chk (fp, 1, "%s", "hello\n");
23
  vi6 = 0;
24
  __fprintf_chk (fp, 1, "%s", "a");
25
  vi7 = 0;
26
  __fprintf_chk (fp, 1, "%c", 'x');
27
  vi8 = 0;
28
  __fprintf_chk (fp, 1, "%d%d", vi0, vi1);
29
  vi9 = 0;
30
}
31
 
32
/* { dg-final { scan-tree-dump "vi0.*fwrite.*\"hello\".*1, 5, fp.*vi1" "fab"} } */
33
/* { dg-final { scan-tree-dump "vi1.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi2" "fab"} } */
34
/* { dg-final { scan-tree-dump "vi2.*fputc.*fp.*vi3" "fab"} } */
35
/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab"} } */
36
/* { dg-final { scan-tree-dump "vi4.*fwrite.*\"hello\".*1, 5, fp.*vi5" "fab"} } */
37
/* { dg-final { scan-tree-dump "vi5.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi6" "fab"} } */
38
/* { dg-final { scan-tree-dump "vi6.*fputc.*fp.*vi7" "fab"} } */
39
/* { dg-final { scan-tree-dump "vi7.*fputc.*fp.*vi8" "fab"} } */
40
/* { dg-final { scan-tree-dump "vi8.*__fprintf_chk.*fp.*1.*\"%d%d\".*vi9" "fab"} } */
41
/* { dg-final { cleanup-tree-dump "fab" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.