merge from gcc
[external/binutils.git] / gdb / testsuite / gdb.base / macscp1.c
index 89a1b07..e754b26 100644 (file)
@@ -5,6 +5,25 @@
 #define STRINGIFY(a) INNER_STRINGIFY(a)
 #define INNER_STRINGIFY(a) #a
 
+#define FIFTY_SEVEN 57
+
+#define FORTY_EIGHT 48
+#undef  FORTY_EIGHT
+
+struct outer
+{
+  struct fields
+  {
+    struct fault
+    {
+      int addr;
+    } fault;
+  } fields;
+};
+struct outer address;
+
+#define addr fields.fault.addr
+
 /* A macro named UNTIL_<func> is #defined until just before the
    definition of the function <func>.
 
@@ -63,6 +82,20 @@ macscp1_3 ()
   puts ("macscp1_3");
 }
 
+void
+macscp_expr (void)
+{
+  int foo = -1;
+
+  foo = 0;  /* set breakpoint here */
+#define MACRO_TO_EXPAND foo
+  foo = 1;
+#undef MACRO_TO_EXPAND
+  foo = 2;
+}
+
+#define TWENTY_THREE 23
+
 int
 main (int argc, char **argv)
 {
@@ -77,4 +110,5 @@ main (int argc, char **argv)
   macscp4_2_from_macscp3 ();
   macscp3_2 ();
   macscp1_3 ();
+  macscp_expr ();
 }