aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/simd23077.d
blob: 150ec9f902e258f078a6849dfcaee72cc77f27c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
// https://issues.dlang.org/show_bug.cgi?id=23077
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-do compile }
// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }

float test23077(float x)
{
    short i = *cast(short*)&x;
    ++i;
    return *cast(float*)&i; // this cast is not allowed in @safe code
}