[Patch, ObjC++, test-suite] Fix encode-3 FAIL on NeXT.

IainS developer@sandoe-acoustics.co.uk
Fri Nov 5 12:09:00 GMT 2010


Hi,

It seems that the current obj-c++.dg/encode-3.mm "fail" is  
intentional...

... that is, we intentionally omit the ReadOnly encoding on types when  
-fnext-runtime is active.
This is compatible with the behavior of ObjC++ up to at least XCode  
3.2.3/Darwin10.

So, it seems that the 'fix' is for the test to check for different  
output for -fnext-runtime.

Shall apply this - or  any other thoughts?
Iain

Index: gcc/testsuite/obj-c++.dg/encode-3.mm
===================================================================
--- gcc/testsuite/obj-c++.dg/encode-3.mm	(revision 166352)
+++ gcc/testsuite/obj-c++.dg/encode-3.mm	(working copy)
@@ -32,6 +32,15 @@ const char *enc3 = @encode(anonymous);
  #define L "l"
  #endif

+/* Darwin (at least, as of XCode 3.2.3/Darwin10) does not encode the  
read-only attribute
+   on types.  Arguably, this is a bug, but we are compatible with  
this when
+   -fnext-runtime is selected.  */
+#ifdef __NEXT_RUNTIME__
+#define E3 "{?=f[10d]i" L "q{Vec<const signed char>=cc" L "q}}"
+#else
+#define E3 "{?=f[10d]i" L "q{Vec<const signed char>=rcrc" L "q}}"
+#endif
+
  int main(void) {
    const char *encode = @encode(long);

@@ -44,7 +53,7 @@ int main(void) {
    if (strcmp (enc2, (const char *)"{Vec<double>=dd" L "q}"))
      abort ();

-  if (strcmp (enc3, (const char *)"{?=f[10d]i" L "q{Vec<const signed  
char>=rcrc" L "q}}"))
+  if (strcmp (enc3, (const char *) E3))
      abort ();

    return 0;



More information about the Gcc-patches mailing list