summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/ultrasp8.c
blob: 068b5cae2de716e3aeb073fde38abe9d6bed4d1b (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
30
31
32
33
34
35
36
37
38
39
/* PR target/10067 */
/* Originator: <dat94ali@ludat.lth.se> */
/* { dg-do compile { target sparc*-*-* } } */
/* { dg-options "-O2 -m64 -mtune=supersparc" { target sparc64-*-* } } */

struct _reent;

extern unsigned long __malloc_trim_threshold;
extern unsigned long __malloc_top_pad;

int _mallopt_r(struct _reent *reent_ptr, int param_number, int value)
{
  __malloc_lock(reent_ptr);

  switch(param_number)
  {
    case -1:
      __malloc_trim_threshold = value;
      __malloc_unlock(reent_ptr);
      return 1;

    case -2:
      __malloc_top_pad = value;
      __malloc_unlock(reent_ptr);
      return 1;

    case -3:
      __malloc_unlock(reent_ptr);
      return 1;

    case -4:
      __malloc_unlock(reent_ptr);
      return value == 0;

    default:
      __malloc_unlock(reent_ptr);
      return 0;
  }
}
OpenPOWER on IntegriCloud