2011-01-24 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / printcmds.c
index 8eddeeeccf870c23934de263845dbad1e8329a63..b3841ae17378196f0dc9bb8bdbd665ceee8231bd 100644 (file)
@@ -90,6 +90,34 @@ struct some_arrays {
 
 struct some_arrays *parrays = &arrays;
 
+enum some_volatile_enum { enumvolval1, enumvolval2 };
+
+/* A volatile enum variable whose name is the same as the enumeration
+   name.  See PR11827.  */
+volatile enum some_volatile_enum some_volatile_enum = enumvolval1;
+
+/* A structure with an embedded array at an offset > 0.  The array has
+   all elements with the same repeating value, which must not be the
+   same as the value of the preceding fields in the structure for the
+   test to be effective.  This tests whether GDB uses the correct
+   element content offsets (relative to the complete `some_struct'
+   value) when counting value repetitions.  */
+struct some_struct
+{
+  int a;
+  int b;
+  unsigned char array[20];
+} some_struct = {
+  0x12345678,
+  0x87654321,
+  {
+    0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+    0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+    0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+    0xaa, 0xaa, 0xaa, 0xaa, 0xaa
+  }
+};
+
 /* -- */
 
 int main ()
This page took 0.025999 seconds and 4 git commands to generate.