Remove unused support for target-based exception catching.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / setvar.c
index ee98b6fcb9e380c16c9abfd1a3806bb2ca9fe513..969de0d5e719b0958bad650bcb967d4a3ff7e495 100644 (file)
@@ -1,10 +1,21 @@
+#include <stdlib.h>
+
+#ifdef PROTOTYPES
+int main (int argc, char **argv, char **envp)
+#else
 main (argc, argv, envp)
      int argc;
      char **argv;
      char **envp;
+#endif
 {
     extern void dummy();
+#ifdef usestubs
+    set_debug_traps();
+    breakpoint();
+#endif
     dummy();
+    return 0;
 }
 
 /* We put main() right up front so its line number doesn't keep changing.  */
@@ -176,8 +187,22 @@ union tu_link {
 enum colors {red, green, blue} color;
 enum cars {chevy, ford, porsche} clunker;
 
-void dummy()
+/**** Enumeration bitfields, supported by GNU C *******/
+
+#ifdef __GNUC__
+enum senum {sm1 = -1, s1 = 1};
+struct senum_field {enum senum field:2; } sef;
+enum uenum {u1 = 1, u2 = 2};
+struct uenum_field {enum uenum field:2; } uef;
+#endif
+
+void
+dummy ()
 {
+  /* setvar.exp wants to allocate memory for constants.  So make sure malloc
+     gets linked into the program.  */
+  malloc (1);
+
   /* Some linkers (e.g. on AIX) remove unreferenced variables,
      so make sure to reference them. */
   v_char = 0;
@@ -245,4 +270,9 @@ void dummy()
 
   v_struct2.v_int_member = v_struct1.v_int_member;
   v_union2.v_short_member = v_union.v_short_member;
+
+#ifdef __GNUC__
+  sef.field = s1;
+  uef.field = u1;
+#endif
 }
This page took 0.02569 seconds and 4 git commands to generate.