aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46883.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46883.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46883.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46883.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46883.c
new file mode 100644
index 000000000..db8527d54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr46883.c
@@ -0,0 +1,13 @@
+void bar (unsigned char *q, unsigned short *data16s, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++)
+ {
+ q[2 * i] =
+ (((data16s[i] & 0xFF) << 8) | ((data16s[i] >> 8) & 0xFF)) & 0xFF;
+ q[2 * i + 1] =
+ ((unsigned short)
+ (((data16s[i] & 0xFF) << 8) | ((data16s[i] >> 8) & 0xFF))) >> 8;
+ }
+}