aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/20030218-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/20030218-1.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/20030218-1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/20030218-1.c b/SingleSource/Regression/C/gcc-c-torture/execute/20030218-1.c
new file mode 100644
index 00000000..8dde7945
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/20030218-1.c
@@ -0,0 +1,25 @@
+/* On H8, the predicate general_operand_src(op,mode) used to ignore
+ mode when op is a (mem (post_inc ...)). As a result, the pattern
+ for extendhisi2 was recognized as extendqisi2. */
+
+extern void abort ();
+extern void exit (int);
+
+short *q;
+
+long
+foo (short *p)
+{
+ long b = *p;
+ q = p + 1;
+ return b;
+}
+
+int
+main ()
+{
+ short a = 0xff00;
+ if (foo (&a) != (long) (short) 0xff00)
+ abort ();
+ exit (0);
+}