OSDN Git Service

PR target/48496
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / arm / pr46788.c
1 /* { dg-options "-mthumb -O2" }  */
2 /* { dg-require-effective-target arm_thumb2_ok } */
3 /* { dg-final { scan-assembler-not "-32768" } } */
4
5 typedef union
6 {
7   unsigned long int u_32_value;
8   struct 
9   {
10     unsigned short int u_16_value_0;
11     unsigned short int u_16_value_1;
12   } u_16_values;
13 } my_union;
14
15
16 unsigned long int Test(const unsigned short int wXe)
17 {
18   my_union dwCalcVal;
19   
20   dwCalcVal.u_16_values.u_16_value_0=wXe;
21   dwCalcVal.u_16_values.u_16_value_1=0x8000u;
22
23   dwCalcVal.u_32_value /=3;
24   
25   return (dwCalcVal.u_32_value);
26 }