repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
obj-c++.dg
/
encode-3.mm
blob
842a0bf37e588fb0d4a89b34579a09e79e24bc4d
1
/* { dg-do run } */
2
3
#include <stdlib.h>
4
#include <string.h>
5
6
template <class T>
7
struct Vec {
8
T x, y;
9
long z;
10
long long zz;
11
};
12
13
Vec<double> dd;
14
const char *enc = @encode(Vec<float>);
15
const char *enc2 = @encode(Vec<double>);
16
17
#ifdef __LP64__
18
#define L "q"
19
#else
20
#define L "l"
21
#endif
22
23
int main(void) {
24
const char *encode = @encode(long);
25
26
if (strcmp (encode, L))
27
abort();
28
29
if (strcmp (enc, "{Vec<float>=ff" L "q}"))
30
abort();
31
32
if (strcmp (enc2, "{Vec<double>=dd" L "q}"))
33
abort();
34
35
return 0;
36
}