test: Make 7r-sign-extend compatible with default ARM gcc.

* lib/tests/scaffold/7r-sign-extend.c: Make "signed" explicit in
signed char types.
This commit is contained in:
Danny Milosavljevic 2020-08-22 20:39:14 +02:00
parent 047014e704
commit 7e23d98494
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -18,16 +18,16 @@
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>. * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/ */
char global_c = -1; signed char global_c = -1;
struct foo struct foo
{ {
char type; signed char type;
}; };
int int
main () main ()
{ {
{ {
char c = -1; signed char c = -1;
int i = c; int i = c;
if (i != -1) if (i != -1)
return 1; return 1;
@ -40,28 +40,28 @@ main ()
} }
{ {
char c = -1; signed char c = -1;
int ints[2] = { c, 0 }; int ints[2] = { c, 0 };
if (ints[0] != -1) if (ints[0] != -1)
return 3; return 3;
} }
{ {
char c = -1; signed char c = -1;
int i = c; int i = c;
if (i != -1) if (i != -1)
return 4; return 4;
} }
{ {
char c = -1; signed char c = -1;
int i = c; int i = c;
if (i != -1) if (i != -1)
return 5; return 5;
} }
{ {
char a[2] = { -1, -129 }; signed char a[2] = { -1, -129 };
int i = a[0]; int i = a[0];
if (i != -1) if (i != -1)
return 6; return 6;
@ -82,8 +82,8 @@ main ()
} }
{ {
char c = -1; signed char c = -1;
char *p = &c; signed char *p = &c;
int i = *p; int i = *p;
if (i != -1) if (i != -1)
return 10; return 10;
@ -91,7 +91,7 @@ main ()
{ {
int i = -129; int i = -129;
i = (char) i; i = (signed char) i;
if (i != 127) if (i != 127)
return 11; return 11;
} }