OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [code-gen4.C] - Blame information for rev 305

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

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// { dg-options "-O" }
3
// GROUPS passed code-generation
4
// Options: -O
5
//
6
// Check that when an int value is assigned to a short int, the proper
7
// half of the int (i.e. the low order half) ends up in the short.
8
//
9
// This fails with 1.32.0 with -O and f1() is inline.
10
//
11
// Workaround - declare "f1_arg" as type "short int".
12
 
13
#include 
14
#include 
15
 
16
short int v2;
17
 
18
long v1 = 0x11117777;
19
 
20
inline void f1 (long f1_arg)
21
{
22
        v2 = f1_arg;
23
}
24
 
25
int main ()
26
{
27
        f1 (v1);
28
 
29
        if (v2 != 0x00007777)
30
          abort ();
31
        else
32
          printf ("PASS\n");
33
}

powered by: WebSVN 2.1.0

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