Add support to GDB for the Renesas rl78 architecture.
[external/binutils.git] / gdb / testsuite / gdb.base / pointers.c
index 8cac2c2..96f2b52 100644 (file)
@@ -71,33 +71,34 @@ float ** ptr_to_ptr_to_float;
 
 int y;
 
+
+typedef long k[5];
+
+typedef struct {
+  k array_variable;
+} S;
+
+S instance;
+
+/* Do nothing function used for forcing some of the above variables to
+   be referenced by the program source.  If the variables are not
+   referenced, some linkers will remove the symbol from the symbol
+   table making it impossible to refer to the variable in gdb.  */
+void usevar (void *var) {}
+
 int main ()
 {
-    void dummy();
-    
-    /* Ensure that malloc is a pointer type; avoid use of "void" and any include files. */
-    /* extern char *malloc();*/
+  void dummy();
+  int more_code();
+  
+  dummy();
 
-    /*  void *malloc(size_t);*/
-    
+  more_code ();
+
+  usevar (&v_int_pointer2);
+  usevar (&rptr);
+  usevar (&y);
 
-    
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
-  dummy();
-/*  v_int_pointer2 = &v_int_pointer;
-  v_unsigned_int_pointer = &v_int;
-  
-  y = (v_unsigned_int_pointer == v_double_pointer);
-  
-  x = v_unsigned_int_pointer * v_double_pointer;
-  
-  v_unsigned_int_pointer = v_double_pointer;
-  
-  v_unsigned_int_pointer = v_unsigned_int;*/
-  
   return 0;
   
 }
@@ -172,5 +173,49 @@ void dummy()
 
 }
 
+void marker1 ()
+{
+}
 
-
+int more_code()
+{
+    char C, *pC, **ppC, ***pppC, ****ppppC, *****pppppC, ******ppppppC;
+    unsigned char UC, *pUC;
+    short S, *pS;
+    unsigned short US, *pUS;
+    int I, *pI;
+    unsigned int UI, *pUI;
+    long L, *pL;
+    unsigned long UL, *pUL;
+    float F, *pF;
+    double D, *pD;
+
+    C = 'A';
+    UC = 21;
+    S = -14;
+    US = 7;
+    I = 102;
+    UI = 1002;
+    L = -234;
+    UL = 234;
+    F = 1.25E10;
+    D = -1.25E-37;
+    pC = &C;
+    ppC = &pC;
+    pppC = &ppC;
+    ppppC = &pppC;
+    pppppC = &ppppC;
+    ppppppC = &pppppC;
+    pUC = &UC;
+    pS = &S;
+    pUS = &US;
+    pI = &I;
+    pUI = &UI;
+    pL = &L;
+    pUL = &UL;
+    pF = &F;
+    pD = &D;
+    
+    marker1();
+    return 0;
+}