[gdb/testsuite] Split up multi-exec test-cases
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / call-rt-st.c
index ad40a70e7d4bb68f84952fe28197d6241ec4788a..072ea8601927f29975ec953478e5cdfe214eda45 100644 (file)
@@ -2,6 +2,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "../lib/unbuffer_output.c"
+
 /**************************************************************************
  * TESTS :
  * function returning large structures, which go on the stack
@@ -31,6 +33,28 @@ struct small_rep_info_t {
    int   head;
 };
 
+/* 6 bits : really fits in 8 bits and is promoted to 8 bits
+ */
+struct bit_flags_char_t {
+       unsigned char alpha   :1;
+       unsigned char beta    :1;
+       unsigned char gamma   :1;
+       unsigned char delta   :1;
+       unsigned char epsilon :1;
+       unsigned char omega   :1;
+};
+
+/* 6 bits : really fits in 8 bits and is promoted to 16 bits
+ */
+struct bit_flags_short_t {
+       unsigned short alpha   :1;
+       unsigned short beta    :1;
+       unsigned short gamma   :1;
+       unsigned short delta   :1;
+       unsigned short epsilon :1;
+       unsigned short omega   :1;
+};
+
 /* 6 bits : really fits in 8 bits and is promoted to 32 bits
  */
 struct bit_flags_t {
@@ -103,7 +127,69 @@ void loop_count () {
 
      int index;
 
-     for (index=0; index<4; index++);
+     for (index=0; index<4; index++); /* -break1- */
+}
+
+/*****************************************************************
+ * INIT_BIT_FLAGS_CHAR :
+ * Initializes a bit_flags_char_t structure. Can call this function see
+ * the call command behavior when integer arguments do not fit into
+ * registers and must be placed on the stack.
+ * OUT struct bit_flags_char_t *bit_flags -- structure to be filled
+ * IN  unsigned a  -- 0 or 1 
+ * IN  unsigned b  -- 0 or 1 
+ * IN  unsigned g  -- 0 or 1 
+ * IN  unsigned d  -- 0 or 1 
+ * IN  unsigned e  -- 0 or 1 
+ * IN  unsigned o  -- 0 or 1 
+ *****************************************************************/
+void init_bit_flags_char (
+struct bit_flags_char_t *bit_flags,
+unsigned a,
+unsigned b,
+unsigned g,
+unsigned d,
+unsigned e,
+unsigned o)
+{
+
+   bit_flags->alpha = a;
+   bit_flags->beta = b;
+   bit_flags->gamma = g;
+   bit_flags->delta = d;
+   bit_flags->epsilon = e;
+   bit_flags->omega = o;
+}
+
+/*****************************************************************
+ * INIT_BIT_FLAGS_SHORT :
+ * Initializes a bit_flags_short_t structure. Can call this function see
+ * the call command behavior when integer arguments do not fit into
+ * registers and must be placed on the stack.
+ * OUT struct bit_flags_short_t *bit_flags -- structure to be filled
+ * IN  unsigned a  -- 0 or 1 
+ * IN  unsigned b  -- 0 or 1 
+ * IN  unsigned g  -- 0 or 1 
+ * IN  unsigned d  -- 0 or 1 
+ * IN  unsigned e  -- 0 or 1 
+ * IN  unsigned o  -- 0 or 1 
+ *****************************************************************/
+void init_bit_flags_short (
+struct bit_flags_short_t *bit_flags,
+unsigned a,
+unsigned b,
+unsigned g,
+unsigned d,
+unsigned e,
+unsigned o)
+{
+
+   bit_flags->alpha = a;
+   bit_flags->beta = b;
+   bit_flags->gamma = g;
+   bit_flags->delta = d;
+   bit_flags->epsilon = e;
+   bit_flags->omega = o;
 }
 
 /*****************************************************************
@@ -119,14 +205,14 @@ void loop_count () {
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-void init_bit_flags (bit_flags,a,b,g,d,e,o) 
-struct bit_flags_t *bit_flags;
-unsigned a;
-unsigned b;
-unsigned g;
-unsigned d;
-unsigned e;
-unsigned o
+void init_bit_flags (
+struct bit_flags_t *bit_flags,
+unsigned a,
+unsigned b,
+unsigned g,
+unsigned d,
+unsigned e,
+unsigned o)
 {
 
    bit_flags->alpha = a;
@@ -152,16 +238,16 @@ unsigned o;
  * IN  unsigned e  -- 0 or 1 
  * IN  unsigned o  -- 0 or 1 
  *****************************************************************/
-void init_bit_flags_combo (bit_flags_combo, a, b, ch1, g, d, ch2, e, o)
-struct bit_flags_combo_t *bit_flags_combo;
-unsigned a;
-unsigned b;
-char ch1;
-unsigned g;
-unsigned d;
-char ch2;
-unsigned e;
-unsigned o;
+void init_bit_flags_combo (
+struct bit_flags_combo_t *bit_flags_combo,
+unsigned a,
+unsigned b,
+char ch1,
+unsigned g,
+unsigned d,
+char ch2,
+unsigned e,
+unsigned o)
 {
 
    bit_flags_combo->alpha = a;
@@ -180,9 +266,7 @@ unsigned o;
  * OUT  struct one_double_t *one_double  -- structure to fill 
  * IN   double init_val
  *****************************************************************/
-void init_one_double (one_double, init_val)
-struct one_double_t *one_double; 
-double init_val;
+void init_one_double ( struct one_double_t *one_double, double init_val)
 {
 
      one_double->double1  = init_val;
@@ -194,10 +278,10 @@ double init_val;
  * IN  float init_val1 
  * IN  float init_val2 
  *****************************************************************/
-void init_two_floats (two_floats, init_val1, init_val2)
-struct two_floats_t *two_floats;
-float init_val1;
-float init_val2;
+void init_two_floats (
+     struct two_floats_t *two_floats,
+     float init_val1,
+     float init_val2)
 {
 
      two_floats->float1 = init_val1;
@@ -211,11 +295,11 @@ float init_val2;
  * IN  char init_val2 
  * IN  char init_val3 
  *****************************************************************/
-void init_three_chars ( three_char, init_val1, init_val2, init_val3)
-struct three_char_t *three_char;
-char init_val1;
-char init_val2;
-char init_val3;
+void init_three_chars (
+struct three_char_t *three_char,
+char init_val1,
+char init_val2,
+char init_val3)
 {
 
      three_char->ch1 = init_val1;
@@ -232,13 +316,13 @@ char init_val3;
  * IN  char init_val4 
  * IN  char init_val5 
  *****************************************************************/
-void init_five_chars ( five_char, init_val1, init_val2, init_val3, init_val4, init_val5)
-struct five_char_t *five_char;
-char init_val1;
-char init_val2;
-char init_val3;
-char init_val4;
-char init_val5;
+void init_five_chars (
+struct five_char_t *five_char,
+char init_val1,
+char init_val2,
+char init_val3,
+char init_val4,
+char init_val5)
 {
 
      five_char->ch1 = init_val1;
@@ -254,10 +338,10 @@ char init_val5;
  * IN  int  init_val1 
  * IN  char init_val2 
  *****************************************************************/
-void init_int_char_combo ( combo, init_val1, init_val2)
-struct int_char_combo_t *combo;
-int init_val1;
-char init_val2;
+void init_int_char_combo (
+struct int_char_combo_t *combo,
+int init_val1,
+char init_val2)
 {
 
      combo->int1 = init_val1;
@@ -269,22 +353,54 @@ char init_val2;
  * OUT struct small_rep_into_t *small_struct -- structure to be filled
  * IN  int  seed 
  *****************************************************************/
-void init_struct_rep( small_struct, seed)
-struct small_rep_info_t *small_struct;
-int    seed;
-
+void init_struct_rep(
+     struct small_rep_info_t *small_struct,
+     int seed)
 {
 
       small_struct->value = 2 + (seed*2); 
       small_struct->head = 0; 
 }
 
+/*****************************************************************
+ * PRINT_BIT_FLAGS_CHAR : 
+ * IN struct bit_flags_char_t bit_flags 
+ ****************************************************************/
+struct bit_flags_char_t print_bit_flags_char (struct bit_flags_char_t bit_flags)
+{
+
+     if (bit_flags.alpha) printf("alpha\n");
+     if (bit_flags.beta) printf("beta\n");
+     if (bit_flags.gamma) printf("gamma\n");
+     if (bit_flags.delta) printf("delta\n");
+     if (bit_flags.epsilon) printf("epsilon\n");
+     if (bit_flags.omega) printf("omega\n");
+     return bit_flags;
+     
+}
+
+/*****************************************************************
+ * PRINT_BIT_FLAGS_SHORT : 
+ * IN struct bit_flags_short_t bit_flags 
+ ****************************************************************/
+struct bit_flags_short_t print_bit_flags_short (struct bit_flags_short_t bit_flags)
+{
+
+     if (bit_flags.alpha) printf("alpha\n");
+     if (bit_flags.beta) printf("beta\n");
+     if (bit_flags.gamma) printf("gamma\n");
+     if (bit_flags.delta) printf("delta\n");
+     if (bit_flags.epsilon) printf("epsilon\n");
+     if (bit_flags.omega) printf("omega\n");
+     return bit_flags;
+     
+}
+
 /*****************************************************************
  * PRINT_BIT_FLAGS : 
  * IN struct bit_flags_t bit_flags 
  ****************************************************************/
-struct bit_flags_t print_bit_flags ( bit_flags)
-struct bit_flags_t bit_flags;
+struct bit_flags_t print_bit_flags (struct bit_flags_t bit_flags)
 {
 
      if (bit_flags.alpha) printf("alpha\n");
@@ -301,8 +417,7 @@ struct bit_flags_t bit_flags;
  * PRINT_BIT_FLAGS_COMBO : 
  * IN struct bit_flags_combo_t bit_flags_combo 
  ****************************************************************/
-struct bit_flags_combo_t print_bit_flags_combo ( bit_flags_combo )
-struct bit_flags_combo_t bit_flags_combo;
+struct bit_flags_combo_t print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
 {
 
      if (bit_flags_combo.alpha) printf("alpha\n");
@@ -320,8 +435,7 @@ struct bit_flags_combo_t bit_flags_combo;
  * PRINT_ONE_DOUBLE : 
  * IN struct one_double_t one_double 
  ****************************************************************/
-struct one_double_t print_one_double ( one_double )
-struct one_double_t one_double;
+struct one_double_t print_one_double (struct one_double_t one_double)
 {
 
      printf("Contents of one_double_t: \n\n");
@@ -334,8 +448,7 @@ struct one_double_t one_double;
  * PRINT_TWO_FLOATS : 
  * IN struct two_floats_t two_floats 
  ****************************************************************/
-struct two_floats_t print_two_floats ( two_floats ) 
-struct two_floats_t two_floats;
+struct two_floats_t print_two_floats (struct two_floats_t two_floats)
 {
 
      printf("Contents of two_floats_t: \n\n");
@@ -348,8 +461,7 @@ struct two_floats_t two_floats;
  * PRINT_THREE_CHARS : 
  * IN struct three_char_t three_char
  ****************************************************************/
-struct three_char_t print_three_chars ( three_char ) 
-struct three_char_t three_char;
+struct three_char_t print_three_chars (struct three_char_t three_char)
 {
 
      printf("Contents of three_char_t: \n\n");
@@ -362,8 +474,7 @@ struct three_char_t three_char;
  * PRINT_FIVE_CHARS : 
  * IN struct five_char_t five_char
  ****************************************************************/
-struct five_char_t print_five_chars ( five_char )
-struct five_char_t five_char;
+struct five_char_t print_five_chars (struct five_char_t five_char)
 {
 
      printf("Contents of five_char_t: \n\n");
@@ -378,8 +489,7 @@ struct five_char_t five_char;
  * PRINT_INT_CHAR_COMBO : 
  * IN struct int_char_combo_t int_char_combo
  ****************************************************************/
-struct int_char_combo_t print_int_char_combo ( int_char_combo )
-struct int_char_combo_t int_char_combo;
+struct int_char_combo_t print_int_char_combo (struct int_char_combo_t int_char_combo)
 {
 
      printf("Contents of int_char_combo_t: \n\n");
@@ -391,9 +501,7 @@ struct int_char_combo_t int_char_combo;
 /*****************************************************************
  * PRINT_STRUCT_REP : 
  ****************************************************************/
-struct small_rep_info_t print_struct_rep( struct1 )
-struct small_rep_info_t struct1;
-
+struct small_rep_info_t print_struct_rep(struct small_rep_info_t struct1)
 {
 
   printf("Contents of struct1: \n\n");
@@ -406,8 +514,7 @@ struct small_rep_info_t struct1;
 }
 
 
-struct array_rep_info_t print_one_large_struct( linked_list1 )
-struct array_rep_info_t linked_list1;
+struct array_rep_info_t print_one_large_struct(struct array_rep_info_t linked_list1)
 {
 
 
@@ -423,10 +530,7 @@ struct array_rep_info_t linked_list1;
  * IN struct array_rep_info_t *linked_list
  * IN int    seed
  ****************************************************************/
-void init_array_rep( linked_list, seed )
-struct array_rep_info_t *linked_list;
-int    seed;
-
+void init_array_rep(struct array_rep_info_t *linked_list, int seed)
 {
 
   int index;
@@ -450,6 +554,8 @@ int main ()  {
   /* variables for testing a small structures and a very long argument list
    */
    struct small_rep_info_t  *struct1;
+   struct bit_flags_char_t  *cflags;
+   struct bit_flags_short_t *sflags;
    struct bit_flags_t       *flags;
    struct bit_flags_combo_t *flags_combo;
    struct three_char_t      *three_char;
@@ -458,6 +564,7 @@ int main ()  {
    struct one_double_t      *d1;
    struct two_floats_t      *f3;
 
+  gdb_unbuffer_output ();
 
   /* Allocate space for large structures 
    */
@@ -474,6 +581,8 @@ int main ()  {
   /* Allocate space for small structures 
    */
   struct1     = (struct small_rep_info_t  *)malloc(sizeof(struct small_rep_info_t));
+  cflags       = (struct bit_flags_char_t *)malloc(sizeof(struct bit_flags_char_t));
+  sflags       = (struct bit_flags_short_t *)malloc(sizeof(struct bit_flags_short_t));
   flags       = (struct bit_flags_t *)malloc(sizeof(struct bit_flags_t));
   flags_combo = (struct bit_flags_combo_t *)malloc(sizeof(struct bit_flags_combo_t));
   three_char  = (struct three_char_t *)malloc(sizeof(struct three_char_t));
@@ -487,6 +596,10 @@ int main ()  {
    */
   init_one_double ( d1, 1.11111); 
   init_two_floats ( f3, -2.345, 1.0); 
+  init_bit_flags_char(cflags, (unsigned)1, (unsigned)0, (unsigned)1, 
+                     (unsigned)0, (unsigned)1, (unsigned)0 ); 
+  init_bit_flags_short(sflags, (unsigned)1, (unsigned)0, (unsigned)1, 
+                      (unsigned)0, (unsigned)1, (unsigned)0 ); 
   init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, 
                 (unsigned)0, (unsigned)1, (unsigned)0 ); 
   init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
@@ -502,6 +615,8 @@ int main ()  {
    */
   print_one_double(*d1);
   print_two_floats(*f3);
+  print_bit_flags_char(*cflags);
+  print_bit_flags_short(*sflags);
   print_bit_flags(*flags);
   print_bit_flags_combo(*flags_combo);
   print_three_chars(*three_char);
@@ -509,9 +624,9 @@ int main ()  {
   print_int_char_combo(*int_char_combo);
   print_struct_rep(*struct1);
 
-  loop_count();
+  loop_count();                        /* -finish2- */
 
-  return 0;
+  return 0;                    /* -finish1- */
 }
 
 
This page took 0.03057 seconds and 4 git commands to generate.