summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/guality/pr45003-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/guality/pr45003-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr45003-2.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/guality/pr45003-2.c b/gcc/testsuite/gcc.dg/guality/pr45003-2.c
new file mode 100644
index 00000000000..dcdba237ff4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr45003-2.c
@@ -0,0 +1,31 @@
+/* PR debug/45003 */
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+int __attribute__((noinline))
+foo (unsigned short *p)
+{
+ int a = *p;
+ asm volatile ("nop" : : "D" ((int) *p));
+ asm volatile ("nop" : : "D" ((int) *p)); /* { dg-final { gdb-test 10 "a" "0x8078" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+bar (short *p)
+{
+ unsigned int a = *p;
+ asm volatile ("nop" : : "D" ((unsigned int) *p));
+ asm volatile ("nop" : : "D" ((unsigned int) *p)); /* { dg-final { gdb-test 19 "a" "0xffff8078" } } */
+ return 0;
+}
+
+int
+main ()
+{
+ unsigned short us = 0x8078;
+ foo (&us);
+ short s = -32648;
+ bar (&s);
+ return 0;
+}