gcc/testsuite/gdc.test/runnable/test21833.d
raw| 1 | // REQUIRED_ARGS: -O -inline |
| 2 | // https://issues.dlang.org/show_bug.cgi?id=20855 |
| 3 | |
| 4 | void testit() |
| 5 | { |
| 6 | pragma(inline, false); |
| 7 | short[4] arr = [-1, 6, 0, 4]; |
| 8 | long1 A = *cast(long1*)(arr.ptr); |
| 9 | assert(_mm_extract_pi16(A, 0) == 65535); |
| 10 | } |
| 11 | |
| 12 | struct short4 |
| 13 | { |
| 14 | short[4] array; |
| 15 | } |
| 16 | |
| 17 | struct long1 |
| 18 | { |
| 19 | long[1] array; |
| 20 | } |
| 21 | |
| 22 | int _mm_extract_pi16 (long1 a, int imm8) |
| 23 | { |
| 24 | return cast(ushort)((cast(short4)a).array[imm8]); |
| 25 | } |
| 26 | |
| 27 | void main() |
| 28 | { |
| 29 | testit(); |
| 30 | } |