aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/memcheck/t2.c
blob: d386eb7ebb144f1b8463abee56709d5cce1ad57c (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
/* Must define:
   int expect_error;
   void test ();
   void setup () NOCHECK; */

#include "driver.h"

int expect_error = 1;

int *ip;

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

int t2 ()
{
  return *ip;
}

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