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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [abi/] [arm_cxa_vec2.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// Check that ARM vector delete functions accept NULL pointers as
2
// inputs.
3
// { dg-do run { target arm*-*-* } }
4
 
5
#ifdef __ARM_EABI__
6
#include 
7
 
8
typedef void *(dtor_type)(void *);
9
 
10
extern "C" {
11
  void abort();
12
  void *__aeabi_vec_dtor_cookie(void *, dtor_type);
13
  void __aeabi_vec_delete(void *, dtor_type);
14
  void __aeabi_vec_delete3(void *,
15
                           dtor_type,
16
                           void (*)(void *, __SIZE_TYPE__));
17
  void __aeabi_vec_delete3_nodtor(void *,
18
                                  void (*)(void *, __SIZE_TYPE__));
19
}
20
 
21
// These functions should never be called.
22
void* dtor(void *)
23
{
24
  abort ();
25
}
26
 
27
void dealloc(void *, size_t) {
28
  abort ();
29
}
30
 
31
int main () {
32
  if (__aeabi_vec_dtor_cookie (NULL, &dtor) != NULL)
33
    return 1;
34
  // These do not return values, but should not crash.
35
  __aeabi_vec_delete (NULL, &dtor);
36
  __aeabi_vec_delete3 (NULL, &dtor, &dealloc);
37
  __aeabi_vec_delete3_nodtor (NULL, &dealloc);
38
}
39
#else
40
int main () {}
41
#endif

powered by: WebSVN 2.1.0

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