aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/memcheck/t1.c
blob: 03b6acc1335d04d52d8893eabb31da1277d15fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Must define:
   int expect_error;
   void test ();
   void setup ();   -- NOCHECK */

#include "driver.h"

int expect_error = 0;

int *ip;

void test ()
{
  ip = c_malloc (sizeof (int));
  *ip = 42;
  t2 ();
}

int t2 ()
{
  return *ip;
}

void setup () /* NOCHECK */
{
  mark_region (&ip, sizeof (ip), ACCESS_RW);
}