This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Add a testcase for PR 15084
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 May 2004 15:10:49 -0700
- Subject: PATCH: Add a testcase for PR 15084
Should I rename it to 15084-1.c and enable it for all targets?
H.J.
---
2004-05-07 H.J. Lu <hongjiu.lu@intel.com>
* gcc.dg/x86_64-insv-1.c: Add a test for PR target/15084.
--- gcc/testsuite/gcc.dg/x86_64-insv-1.c.15084 2004-05-07 14:47:10.000000000 -0700
+++ gcc/testsuite/gcc.dg/x86_64-insv-1.c 2004-05-07 14:02:34.000000000 -0700
@@ -0,0 +1,73 @@
+/* PR target/15084 */
+/* { dg-do run { target x86_64-*-* } } */
+/* { dg-options "-O2" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define MP_INTSRC 3
+#define mp_INT 0
+#define MP_ISA_BUS 0
+
+struct mpc_config_intsrc
+{
+ unsigned char mpc_type;
+ unsigned char mpc_irqtype;
+ unsigned short mpc_irqflag;
+ unsigned char mpc_srcbus;
+ unsigned char mpc_srcbusirq;
+ unsigned char mpc_dstapic;
+ unsigned char mpc_dstirq;
+};
+
+#define MAX_IRQ_SOURCES 255
+struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
+int mp_irq_entries = 0;
+
+void mp_config_acpi_legacy_irqs (void)
+{
+ struct mpc_config_intsrc intsrc;
+ int i = 0;
+
+ intsrc.mpc_type = MP_INTSRC;
+ intsrc.mpc_irqflag = 0;
+ intsrc.mpc_srcbus = MP_ISA_BUS;
+ /*
+ * set to a dummy value!! This will disappear
+ */
+ intsrc.mpc_dstapic = 10;
+
+ for (i = 0; i < 16; i++) {
+ int idx;
+
+ for (idx = 0; idx < mp_irq_entries; idx++)
+ if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS &&
+ (mp_irqs[idx].mpc_srcbusirq == i ||
+ mp_irqs[idx].mpc_dstirq == i))
+ break;
+
+ if (idx != mp_irq_entries) {
+ continue;
+ }
+ intsrc.mpc_irqtype = mp_INT;
+ intsrc.mpc_srcbusirq = i;
+ intsrc.mpc_dstirq = i;
+
+ mp_irqs[mp_irq_entries] = intsrc;
+ if (++mp_irq_entries == MAX_IRQ_SOURCES)
+ printf ("Max # of irq sources exceeded!\n");
+
+ }
+
+ return;
+}
+
+int
+main() {
+
+ mp_config_acpi_legacy_irqs();
+
+ if (mp_irqs[0].mpc_dstapic != 10)
+ abort ();
+ return 0;
+}