7d384cc0b3
Fine-grained control of -fcheck-memory-usage with new no_check_memory_usage attribute. Misc minor bugfixes and tests for it too. From-SVN: r22983
35 lines
425 B
C
35 lines
425 B
C
/* Must define:
|
|
int expect_error;
|
|
void test ();
|
|
void setup () NOCHECK; */
|
|
|
|
#include "driver.h"
|
|
|
|
int expect_error = 0;
|
|
|
|
struct s {
|
|
char c;
|
|
int a, b;
|
|
};
|
|
|
|
struct s *sp;
|
|
|
|
void test ()
|
|
{
|
|
sp = c_malloc (sizeof (struct s));
|
|
sp->c = 0;
|
|
sp->a = 12;
|
|
sp->b = 47;
|
|
foo (sp);
|
|
}
|
|
|
|
int foo (struct s *sp)
|
|
{
|
|
return sp->c + sp->a + sp->b;
|
|
}
|
|
|
|
void setup () /* NOCHECK */
|
|
{
|
|
mark_region (&sp, sizeof (sp), ACCESS_RW);
|
|
}
|