summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr45982.c
blob: 4aea6a8d8e47eec1d1cdc52890d0ba78c3d12e15 (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
/* { dg-do run } */
/* { dg-options "-std=c99" } */

#include <stdint.h>

extern void abort (void);

uintptr_t __attribute__((pure,noinline,noclone))
foo (int *a)
{
  return (uintptr_t) a;
}

void __attribute__((noinline,noclone))
bar (uintptr_t a)
{
  int *p = (int *)a;
  *p = 1;
}

int main()
{
  int t = 0;
  bar (foo (&t));
  if (t != 1)
    abort ();
  return 0;
}