avr-libc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-commit] [2531] Fix a number of simulation issues where either


From: j
Subject: [avr-libc-commit] [2531] Fix a number of simulation issues where either the compiler complained
Date: Tue, 6 Dec 2016 21:12:03 +0000 (UTC)

Revision: 2531
          http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2531
Author:   joerg_wunsch
Date:     2016-12-06 21:12:03 +0000 (Tue, 06 Dec 2016)
Log Message:
-----------
Fix a number of simulation issues where either the compiler complained
about something, or the code needs to be adapted to the no longer
available prog_char.

Modified Paths:
--------------
    trunk/avr-libc/tests/simulate/printf/vsnprintf_all.c
    trunk/avr-libc/tests/simulate/runtest.sh
    trunk/avr-libc/tests/simulate/stdlib/dtostre.h

Modified: trunk/avr-libc/tests/simulate/printf/vsnprintf_all.c
===================================================================
--- trunk/avr-libc/tests/simulate/printf/vsnprintf_all.c        2016-12-06 
20:21:44 UTC (rev 2530)
+++ trunk/avr-libc/tests/simulate/printf/vsnprintf_all.c        2016-12-06 
21:12:03 UTC (rev 2531)
@@ -91,8 +91,8 @@
 
 #define FILLBUF        0x55    /* Before call of function to test
                           buf[] is filled with nonzero value.  */
-#define CHECK(expval, expstr, buf, size, fmt, ...)     \
-    memset (buf, FILLBUF, sizeof(buf));                        \
+#define CHECK(expval, expstr, buf, bufsize, size, fmt, ...)    \
+    memset (buf, FILLBUF, bufsize);                    \
     Check (__LINE__, expval, PSTR(expstr),             \
           buf, size, PFMT(fmt), ##__VA_ARGS__)
 
@@ -102,7 +102,7 @@
     int i;
 
     /* size == 0       */
-    CHECK (0, "", s+10, 0, "");
+    CHECK (0, "", s+10, sizeof(s)-10, 0, "");
 
     /* bug #19280: snprintf(s,0,...) write to s[-1]    */
     memset (s, FILLBUF, sizeof(s));
@@ -114,20 +114,20 @@
 
     /* size == 1       */
     s[0] = 1;
-    CHECK (0, "", s, 1, "");
-    CHECK (3, "", s, 1, "foo");
+    CHECK (0, "", s, sizeof(s), 1, "");
+    CHECK (3, "", s, sizeof(s), 1, "foo");
 
     /* size == 2       */
-    CHECK (0, "", s, 2, "");
-    CHECK (1, ".", s, 2, ".");
-    CHECK (2, "a", s, 2, "aa");
-    CHECK (5, "1", s, 2, "%d", 12345);
+    CHECK (0, "", s, sizeof(s), 2, "");
+    CHECK (1, ".", s, sizeof(s), 2, ".");
+    CHECK (2, "a", s, sizeof(s), 2, "aa");
+    CHECK (5, "1", s, sizeof(s), 2, "%d", 12345);
 
     /* big size        */
-    CHECK (6, "-12345", s, sizeof(s), "%d", -12345);
-    CHECK (5, "54321", s, ~0u >> 1, "%u", 54321);              /* 32767 */
-    CHECK (4, "abcd", s, ~(~0u >> 1), "%x", 0xabcd);           /* 32768 */
-    CHECK (3, "123", s, ~0u, "%o", 0123);                      /* 65535 */
+    CHECK (6, "-12345", s, sizeof(s), sizeof(s), "%d", -12345);
+    CHECK (5, "54321", s, sizeof(s), ~0u >> 1, "%u", 54321);           /* 
32767 */
+    CHECK (4, "abcd", s, sizeof(s), ~(~0u >> 1), "%x", 0xabcd);                
/* 32768 */
+    CHECK (3, "123", s, sizeof(s), ~0u, "%o", 0123);                   /* 
65535 */
 
     return 0;
 }

Modified: trunk/avr-libc/tests/simulate/runtest.sh
===================================================================
--- trunk/avr-libc/tests/simulate/runtest.sh    2016-12-06 20:21:44 UTC (rev 
2530)
+++ trunk/avr-libc/tests/simulate/runtest.sh    2016-12-06 21:12:03 UTC (rev 
2531)
@@ -122,12 +122,9 @@
 # Usage: Simulate ELFILE MCU
 Simulate ()
 {
-    local exit_addr=0x`$AVR_NM $1 | grep __stop_program | cut -f1 -d' '`
-    # change the exit address from byte address to word address
-    exit_addr=`printf "0x%08x" $((exit_addr/2))`
     rm -f $CORE
     # pass device name, exit address, elf file, dump file and timeout (60 
seconds).
-    if $SIMULAVR -d $2 -B $exit_addr -f $1 -C $CORE -m 60000000000 2>&1 
>/dev/null \
+    if $SIMULAVR -d $2 -T __stop_program -f $1 -C $CORE -m 60000000000 2>&1 
>/dev/null \
        | grep "ERROR:"
     then
        RETVAL=-1

Modified: trunk/avr-libc/tests/simulate/stdlib/dtostre.h
===================================================================
--- trunk/avr-libc/tests/simulate/stdlib/dtostre.h      2016-12-06 20:21:44 UTC 
(rev 2530)
+++ trunk/avr-libc/tests/simulate/stdlib/dtostre.h      2016-12-06 21:12:03 UTC 
(rev 2531)
@@ -89,7 +89,7 @@
     unsigned char prec, flags;
     static char s[2*PZLEN + sizeof(pt->pattern)];
     char c, *ps;
-    void *pv;
+    const void *pv;
     
     memset(s, testno, sizeof(s));
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]