summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/mpx/pointer-store-1-nov.c
blob: 269e3af17f04f147dfaf9cb6dd996de34f014ad1 (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
28
29
/* { dg-do run } */
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */


#include "mpx-check.h"

int *buf1[100];
int buf2[100];

void wr (int i)
{
  buf1[i] = buf2;
}

int rd(int i, int j)
{
  int res = buf1[i][j];
  printf("%d\n", res);
  return res;
}

int mpx_test (int argc, const char **argv)
{
  wr(10);
  rd(10, 0);
  rd(10, 99);

  return 0;
}