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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [20000825-1.c] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
typedef signed int      s32;
2
typedef signed long     s64;
3
typedef unsigned int    u32;
4
typedef unsigned long   u64;
5
 
6
extern __inline__ u32 foobar(int logmask)
7
{
8
        u32 ret = ~(1 << logmask);      // fails
9
        // s32 ret = ~(1 << logmask);   // ok
10
        // u64 ret = ~(1 << logmask);   // ok
11
        // s64 ret = ~(1 << logmask);   // ok
12
        return ret;
13
}
14
 
15
// This procedure compiles fine...
16
u32 good(u32 var)
17
{
18
        var = foobar(0);
19
        return var;
20
}
21
 
22
// This procedure does not compile...
23
// Same as above, but formal parameter is a pointer
24
// Both good() and fails() compile ok if we choose
25
// a different type for "ret" in foobar().
26
u32 fails(u32 *var)
27
{
28
        *var = foobar(0);
29
        return *var;
30
}
31
 

powered by: WebSVN 2.1.0

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