URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 738 |
Rev 783 |
#include <stdio.h>
|
#include <stdio.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <string.h>
|
#include <string.h>
|
void *p;
|
void *p;
|
int main ()
|
int main ()
|
{
|
{
|
struct base {
|
struct base {
|
int basic;
|
int basic;
|
};
|
};
|
|
|
struct derived {
|
struct derived {
|
struct base common;
|
struct base common;
|
char extra;
|
char extra;
|
};
|
};
|
|
|
struct base *bp;
|
struct base *bp;
|
|
|
bp = (struct base *) malloc (sizeof (struct base));;
|
bp = (struct base *) malloc (sizeof (struct base));;
|
p = bp;
|
p = bp;
|
bp->basic = 10;
|
bp->basic = 10;
|
((struct derived *)bp)->extra = 'x';
|
((struct derived *)bp)->extra = 'x';
|
return 0;
|
return 0;
|
}
|
}
|
/* { dg-output "mudflap violation 1.*" } */
|
/* { dg-output "mudflap violation 1.*" } */
|
/* { dg-output "Nearby object 1.*" } */
|
/* { dg-output "Nearby object 1.*" } */
|
/* { dg-output "mudflap object.*.malloc region.*" } */
|
/* { dg-output "mudflap object.*.malloc region.*" } */
|
/* { dg-do run { xfail *-*-* } } */
|
/* { dg-do run { xfail *-*-* } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.