Commit bf01e070 by Senthil Kumar Selvaraj Committed by Senthil Kumar Selvaraj

Fix tests for targets with sizeof(int) != 32.

gcc/testsuite/

	* gcc.dg/torture/pr69352.c (foo): Cast to intptr_t instead of long.
	* gcc.dg/torture/pr69771.c: Require int32plus.
	* gcc.dg/torture/pr71866.c (inb): Add cast to intptr_t.

From-SVN: r238708
parent 10c9ea62
2016-07-25 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.dg/torture/pr69352.c (foo): Cast to intptr_t instead of long.
* gcc.dg/torture/pr69771.c: Require int32plus.
* gcc.dg/torture/pr71866.c (inb): Add cast to intptr_t.
2016-07-25 Martin Liska <mliska@suse.cz> 2016-07-25 Martin Liska <mliska@suse.cz>
* gcc.dg/torture/pr71987.c: New test. * gcc.dg/torture/pr71987.c: New test.
......
/* { dg-do compile } */ /* { dg-do compile } */
#include <stdint.h>
int a[10][14], b, c, d, e, f, g, h, i; int a[10][14], b, c, d, e, f, g, h, i;
void bar (void); void bar (void);
int int
...@@ -13,7 +15,7 @@ foo (int x) ...@@ -13,7 +15,7 @@ foo (int x)
else else
m = 13; m = 13;
if (a[x][m]) if (a[x][m])
l = (long) foo; l = (intptr_t) foo;
a[x][i] = l; a[x][i] = l;
while (c) while (c)
{ {
......
/* PR rtl-optimization/69771 */ /* PR rtl-optimization/69771 */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-require-effective-target int32plus } */
unsigned char a = 5, c; unsigned char a = 5, c;
unsigned short b = 0; unsigned short b = 0;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-additional-options "-ftree-pre -fcode-hoisting" } */ /* { dg-additional-options "-ftree-pre -fcode-hoisting" } */
#include <stdint.h>
typedef unsigned char u8; typedef unsigned char u8;
extern unsigned long pci_io_base; extern unsigned long pci_io_base;
u8 in_8 (const volatile void *); u8 in_8 (const volatile void *);
...@@ -25,7 +26,7 @@ u8 readb (const volatile void * addr) ...@@ -25,7 +26,7 @@ u8 readb (const volatile void * addr)
static inline static inline
u8 inb (unsigned long port) u8 inb (unsigned long port)
{ {
return readb((volatile void *)pci_io_base + port); return readb((volatile void *)(intptr_t)pci_io_base + port);
} }
static inline static inline
void outb (u8 val, unsigned long port) void outb (u8 val, unsigned long port)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment