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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr19831-3.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-optimized" } */
3
 
4
void test2(void)
5
{
6
  int *p = __builtin_malloc (sizeof (int) * 4);
7
  if (p == (void *)0)
8
    __builtin_abort ();
9
  __builtin_free (p);
10
}
11
 
12
void test5(int b)
13
{
14
  int *p = __builtin_malloc (sizeof (int) * 4);
15
  if (p)
16
    __builtin_free (p);
17
}
18
 
19
void test6(void)
20
{
21
  int *p = __builtin_malloc (sizeof (int) * 4);
22
  if (p == (void *)0)
23
    __builtin_abort ();
24
  if (p)
25
    __builtin_free (p);
26
}
27
 
28
/* We should be able to remove all malloc/free pairs with CDDCE.
29
   Assume p was non-NULL for test2.
30
   For test5, it doesn't matter if p is NULL or non-NULL.  */
31
 
32
/* { dg-final { scan-tree-dump-times "free" 0 "optimized" { xfail *-*-* } } } */
33
/* { dg-final { scan-tree-dump-times "malloc" 0 "optimized" { xfail *-*-* } } } */
34
 
35
/* But make sure we don't partially optimize for now.  */
36
 
37
/* { dg-final { scan-tree-dump-times "free" 3 "optimized" } } */
38
/* { dg-final { scan-tree-dump-times "malloc" 3 "optimized" } } */
39
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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