OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr47411.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
 
3
typedef long unsigned int size_t;
4
 
5
static __inline void *
6
__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
7
{
8
  return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
9
}
10
 
11
extern void *xmalloc (size_t) __attribute__ ((__malloc__));
12
 
13
struct htab { void ** entries; };
14
 
15
typedef struct htab *htab_t;
16
 
17
extern void ** htab_find_slot (htab_t, const void *);
18
 
19
enum mode_class { MODE_RANDOM, MODE_CC, MODE_INT, MAX_MODE_CLASS };
20
 
21
struct mode_data
22
{
23
  struct mode_data *next;
24
  enum mode_class cl;
25
};
26
 
27
static const struct mode_data blank_mode = { 0, MAX_MODE_CLASS };
28
 
29
static htab_t modes_by_name;
30
 
31
struct mode_data *
32
new_mode (void)
33
{
34
  struct mode_data *m
35
    = ((struct mode_data *) xmalloc (sizeof (struct mode_data)));
36
 
37
  ((__builtin_object_size (m, 0) != (size_t) -1) ? __builtin___memcpy_chk (m, &blank_mode, sizeof (struct mode_data), __builtin_object_size (m, 0)) : __inline_memcpy_chk (m, &blank_mode, sizeof (struct mode_data)));
38
 
39
  *htab_find_slot (modes_by_name, m) = m;
40
 
41
  return m;
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.