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-printf-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
extern int __printf_chk (int, const char *, ...);
5
volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
6
 
7
void test (void)
8
{
9
  vi0 = 0;
10
  __printf_chk (1, "hello");
11
  vi1 = 0;
12
  __printf_chk (1, "hello\n");
13
  vi2 = 0;
14
  __printf_chk (1, "a");
15
  vi3 = 0;
16
  __printf_chk (1, "");
17
  vi4 = 0;
18
  __printf_chk (1, "%s", "hello");
19
  vi5 = 0;
20
  __printf_chk (1, "%s", "hello\n");
21
  vi6 = 0;
22
  __printf_chk (1, "%s", "a");
23
  vi7 = 0;
24
  __printf_chk (1, "%s", "");
25
  vi8 = 0;
26
  __printf_chk (1, "%c", 'x');
27
  vi9 = 0;
28
  __printf_chk (1, "%s\n", "hello\n");
29
  via = 0;
30
}
31
 
32
/* { dg-final { scan-tree-dump "vi0.*__printf_chk.*1.*\"hello\".*vi1" "fab"} } */
33
/* { dg-final { scan-tree-dump "vi1.*puts.*\"hello\".*vi2" "fab"} } */
34
/* { dg-final { scan-tree-dump "vi2.*putchar.*vi3" "fab"} } */
35
/* { dg-final { scan-tree-dump "vi3 = 0\[^\(\)\]*vi4 = 0" "fab"} } */
36
/* { dg-final { scan-tree-dump "vi4.*__printf_chk.*1.*\"hello\".*vi5" "fab"} } */
37
/* { dg-final { scan-tree-dump "vi5.*puts.*\"hello\".*vi6" "fab"} } */
38
/* { dg-final { scan-tree-dump "vi6.*putchar.*vi7" "fab"} } */
39
/* { dg-final { scan-tree-dump "vi7 = 0\[^\(\)\]*vi8 = 0" "fab"} } */
40
/* { dg-final { scan-tree-dump "vi8.*putchar.*vi9" "fab"} } */
41
/* { dg-final { scan-tree-dump "vi9.*puts.*\"hello\\\\n\".*via" "fab"} } */
42
/* { 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.