summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr54515.C
blob: 11ed46893bf9890d4a1be03f24f2d7287136a320 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-do compile }
// { dg-options "-O2" }

template < typename T > T h2le (T)
{
    T a;
    unsigned short &b = a;
    short c = 0;
    unsigned char (&d)[2] = reinterpret_cast < unsigned char (&)[2] > (c);
    unsigned char (&e)[2] = reinterpret_cast < unsigned char (&)[2] > (b);
    e[0] = d[0];
    return a;
}

void
bar ()
{
    h2le ((unsigned short) 0);
}