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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Warray-bounds-5.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-O2 -Warray-bounds" }
3
 
4
void f();
5
 
6
int c[3];
7
int result;
8
 
9
struct Vector {
10
    static int get(int i) {
11
        if (i >= 3)
12
            f();
13
        return c[i];
14
    }
15
};
16
 
17
void g()
18
{
19
    for (int i = 0; i < 3; ++i) {
20
        const int index = i % 3;
21
        result = Vector::get(index) + Vector::get(index);
22
    }
23
}
24
 

powered by: WebSVN 2.1.0

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