aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/encode-3.mm
blob: c67a972ddceea0c0f3a30731d5b2bdc760848a83 (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
/* { dg-do run } */

#include <stdlib.h>
#include <string.h>

template <class T>
struct Vec {
 T x, y;
 long z;
 long long zz;
};

Vec<double> dd;
const char *enc = @encode(Vec<float>);
const char *enc2 = @encode(Vec<double>);

int main(void) {
  char *encode = @encode(long);

  if (strcmp (encode, "l"))
    abort();

  if (strcmp (enc, "{Vec<float>=fflq}"))
    abort();

  if (strcmp (enc2, "{Vec<double>=ddlq}"))
    abort();

  return 0;
}