[RFA] Fix csky and c6x build failures
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr56157.c
blob796e3235c299d7d990ef94076783f52ba2257caa
1 /* { dg-do compile } */
2 /* { dg-options "-ftree-vectorize" } */
4 struct Pixel {
5 unsigned short r;
6 unsigned short g;
7 unsigned short b;
8 unsigned short a;
9 };
11 void fn(unsigned char * __restrict dst, const unsigned char * __restrict src)
13 unsigned x;
14 for(x = 0; x < 1024; x += 1)
16 struct Pixel pixel;
17 pixel.r = (unsigned short)(((unsigned)src[0]) * 0xffff / 0xff);
18 pixel.g = (unsigned short)(((unsigned)src[1]) * 0xffff / 0xff);
19 pixel.b = (unsigned short)(((unsigned)src[2]) * 0xffff / 0xff);
20 pixel.a = (unsigned short)(((unsigned)src[3]) * 0xffff / 0xff);
21 __builtin_memcpy(dst, &pixel, sizeof pixel);
22 src += 4;
23 dst += 8;