Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.c-torture/execute/pr84524.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* PR target/84524 */ | |
2 | |
3 __attribute__((noipa)) void | |
4 foo (unsigned short *x) | |
5 { | |
6 unsigned short i, v; | |
7 unsigned char j; | |
8 for (i = 0; i < 256; i++) | |
9 { | |
10 v = i << 8; | |
11 for (j = 0; j < 8; j++) | |
12 if (v & 0x8000) | |
13 v = (v << 1) ^ 0x1021; | |
14 else | |
15 v = v << 1; | |
16 x[i] = v; | |
17 } | |
18 } | |
19 | |
20 int | |
21 main () | |
22 { | |
23 unsigned short a[256]; | |
24 | |
25 foo (a); | |
26 for (int i = 0; i < 256; i++) | |
27 { | |
28 unsigned short v = i << 8; | |
29 for (int j = 0; j < 8; j++) | |
30 { | |
31 asm volatile ("" : "+r" (v)); | |
32 if (v & 0x8000) | |
33 v = (v << 1) ^ 0x1021; | |
34 else | |
35 v = v << 1; | |
36 } | |
37 if (a[i] != v) | |
38 __builtin_abort (); | |
39 } | |
40 return 0; | |
41 } |