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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [builtin-vfprintf-chk-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-fab" } */
3
 
4
#include <stdarg.h>
5
 
6
typedef struct { int i; } FILE;
7
FILE *fp;
8
extern int __vfprintf_chk (FILE *, int, const char *, va_list);
9
volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
10
 
11
void
12
test (va_list ap1, va_list ap2, va_list ap3, va_list ap4, va_list ap5,
13
      va_list ap6, va_list ap7)
14
{
15
  vi0 = 0;
16
  __vfprintf_chk (fp, 1, "hello", ap1);
17
  vi1 = 0;
18
  __vfprintf_chk (fp, 1, "hello\n", ap2);
19
  vi2 = 0;
20
  __vfprintf_chk (fp, 1, "a", ap3);
21
  vi3 = 0;
22
  __vfprintf_chk (fp, 1, "", ap4);
23
  vi4 = 0;
24
  __vfprintf_chk (fp, 1, "%s", ap5);
25
  vi5 = 0;
26
  __vfprintf_chk (fp, 1, "%c", ap6);
27
  vi6 = 0;
28
  __vfprintf_chk (fp, 1, "%s\n", ap7);
29
  vi7 = 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 = 0\[^\(\)\]*vi4 = 0" "fab"} } */
36
/* { dg-final { scan-tree-dump "vi4.*__vfprintf_chk.*fp.*1.*\"%s\".*vi5" "fab"} } */
37
/* { dg-final { scan-tree-dump "vi5.*__vfprintf_chk.*fp.*1.*\"%c\".*vi6" "fab"} } */
38
/* { dg-final { scan-tree-dump "vi6.*__vfprintf_chk.*fp.*1.*\"%s\\\\n\".*vi7" "fab"} } */
39
/* { 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.