summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/pr46788.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/arm/pr46788.c')
-rw-r--r--gcc/testsuite/gcc.target/arm/pr46788.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/pr46788.c b/gcc/testsuite/gcc.target/arm/pr46788.c
new file mode 100644
index 000000000..223676946
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr46788.c
@@ -0,0 +1,26 @@
+/* { dg-options "-mthumb -O2" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-final { scan-assembler-not "-32768" } } */
+
+typedef union
+{
+ unsigned long int u_32_value;
+ struct
+ {
+ unsigned short int u_16_value_0;
+ unsigned short int u_16_value_1;
+ } u_16_values;
+} my_union;
+
+
+unsigned long int Test(const unsigned short int wXe)
+{
+ my_union dwCalcVal;
+
+ dwCalcVal.u_16_values.u_16_value_0=wXe;
+ dwCalcVal.u_16_values.u_16_value_1=0x8000u;
+
+ dwCalcVal.u_32_value /=3;
+
+ return (dwCalcVal.u_32_value);
+}