OSDN Git Service

2010-07-03 Iain Sandoe <iains@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / encode-3.mm
index c121790..8627a77 100644 (file)
@@ -1,18 +1,30 @@
-/* { dg-do run { xfail { "*-*-*" } } } PR32052 */
+/* { dg-do run } */
 
-#include <stdlib.h>
-#include <string.h>
+extern "C" {
+extern void _exit(int);
+extern int strcmp(const char *, const char *);
+}
 
 template <class T>
 struct Vec {
- T x, y;
- long z;
- long long zz;
 T x, y;
 long z;
 long long zz;
 };
 
-Vec<double> dd;
+typedef struct {
+  float fscalar;
+  double dv[10];
+  int iscalar;
+  long z;
+  long long zz;
+  Vec<const signed char> cv;
+} anonymous;
+
+//Vec<double> dd;
 const char *enc = @encode(Vec<float>);
 const char *enc2 = @encode(Vec<double>);
+const char *enc3 = @encode(anonymous);
 
 #ifdef __LP64__
 #define L "q"
@@ -24,13 +36,16 @@ int main(void) {
   const char *encode = @encode(long);
 
   if (strcmp (encode, L))
-    abort();
+    _exit(-(__LINE__));
 
   if (strcmp (enc, "{Vec<float>=ff" L "q}"))
-    abort();
+    _exit(-(__LINE__));
 
   if (strcmp (enc2, "{Vec<double>=dd" L "q}"))
-    abort();
+    _exit(-(__LINE__));
+
+  if (strcmp (enc3, "{?=f[10d]i" L "q{Vec<const signed char>=rcrc" L "q}}"))
+    _exit(-(__LINE__));
 
   return 0;
 }