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

Subversion Repositories openrisc

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

Go to most recent revision | 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
struct abc {
5
    void (*abc_call)(void);
6
};
7
 
8
/*
9
 * Use only any one of the three definitions below at a time:
10
 *
11
 * 1. nothing optimized away. Good.
12
 * 2. call_func() _not_ optimized away, but struct xyz is. gcc disappoints.
13
 * 3. both call_func() and struct xyz optimized away. Nice.
14
 */
15
 
16
/* 1 */
17
/*extern int do_register(struct abc *xyz);*/
18
 
19
/* 2 */
20
static inline int do_register(struct abc *xyz)
21
{
22
    return 0;
23
}
24
 
25
/* 3 */
26
/*#define do_register(xyz)    do { (void)(xyz); } while (0)*/
27
 
28
static void call_func(void)
29
{
30
}
31
 
32
static struct abc xyz = {
33
    .abc_call = call_func,
34
};
35
 
36
void func(void)
37
{
38
    do_register(&xyz);
39
}
40
 
41
/* { dg-final { scan-tree-dump-not "call_func" "optimized"} } */
42
/* { 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.