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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [encode-3.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* { dg-do run } */
2
 
3
extern "C" {
4
extern void abort (void);
5
extern int strcmp (const char *, const char *);
6
}
7
 
8
template 
9
struct Vec {
10
  T x, y;
11
  long z;
12
  long long zz;
13
};
14
 
15
typedef struct {
16
  float fscalar;
17
  double dv[10];
18
  int iscalar;
19
  long z;
20
  long long zz;
21
  Vec cv;
22
} anonymous;
23
 
24
//Vec dd;
25
const char *enc = @encode(Vec);
26
const char *enc2 = @encode(Vec);
27
const char *enc3 = @encode(anonymous);
28
 
29
#ifdef __LP64__
30
#define L "q"
31
#else
32
#define L "l"
33
#endif
34
 
35
/* Darwin (at least, as of XCode 3.2.3/Darwin10) does not encode the read-only
36
   attribute  on the type.  Arguably, this is a bug, but we are compatible
37
   with this when -fnext-runtime is selected.  */
38
#ifdef __NEXT_RUNTIME__
39
#define E3 "{?=f[10d]i" L "q{Vec=cc" L "q}}"
40
#else
41
#define E3 "{?=f[10d]i" L "q{Vec=rcrc" L "q}}"
42
#endif
43
 
44
int main(void) {
45
  const char *encode = @encode(long);
46
 
47
  if (strcmp (encode, L))
48
    abort ();
49
 
50
  if (strcmp (enc, (const char *)"{Vec=ff" L "q}"))
51
    abort ();
52
 
53
  if (strcmp (enc2, (const char *)"{Vec=dd" L "q}"))
54
    abort ();
55
 
56
  if (strcmp (enc3, (const char *) E3))
57
    abort ();
58
 
59
  return 0;
60
}

powered by: WebSVN 2.1.0

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