diff options
author | Iain Sandoe <iains@gcc.gnu.org> | 2011-01-12 11:04:14 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2011-01-12 11:04:14 +0000 |
commit | 2a6793fc09787a40b0d3013712e87815edd8d2b2 (patch) | |
tree | 36b4b2f8be05718577b7e06c95b14aac9fda1642 /gcc/testsuite/obj-c++.dg | |
parent | d72ae3bf1063575af1853c40ec75eee4818b8c3c (diff) | |
download | gcc-2a6793fc09787a40b0d3013712e87815edd8d2b2.tar.gz |
Object1.h: Add copyright header, update comments.
gcc/testsuite:
* objc-obj-c++-shared/Object1.h: Add copyright header, update
comments. Add a TEST_SUITE_ADDITIONS category for GNU runtime.
Amend NeXT version to declare a TEST_SUITE_ADDITIONS carrying the
methods missing from the OBJC2 Object.
* objc-obj-c++-shared/Object1-implementation.h: Add copyright header.
Amend implementation to use a TEST_SUITE_ADDITIONS category for both GNU
and NeXT runtimes.
* objc-obj-c++-shared/Object1.mm: Remove redundant header, update
comments.
* objc-obj-c++-shared/Object1.m: Likewise.
* objc.dg/encode-3.m: Update header use. Amend to be API2 compatible.
* objc.dg/proto-qual-1.m: Likewise.
* obj-c++.dg/proto-lossage-3.mm: Likewise.
* obj-c++.dg/proto-qual-1.mm: Likewise.
From-SVN: r168705
Diffstat (limited to 'gcc/testsuite/obj-c++.dg')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/proto-lossage-3.mm | 5 | ||||
-rw-r--r-- | gcc/testsuite/obj-c++.dg/proto-qual-1.mm | 26 |
2 files changed, 25 insertions, 6 deletions
diff --git a/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm b/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm index 7a51d952248..8a6623ecda0 100644 --- a/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm +++ b/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm @@ -3,9 +3,10 @@ Problem report and original fix by richard@brainstorm.co.uk. */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-sources "../objc-obj-c++-shared/Object1.mm" } */ + +#include "../objc-obj-c++-shared/next-mapping.h" #include "../objc-obj-c++-shared/Protocol1.h" -#include <objc/objc.h> -#include <objc/Object.h> @protocol NoInstanceMethods + testMethod; diff --git a/gcc/testsuite/obj-c++.dg/proto-qual-1.mm b/gcc/testsuite/obj-c++.dg/proto-qual-1.mm index caf1eab2cc7..959181b8641 100644 --- a/gcc/testsuite/obj-c++.dg/proto-qual-1.mm +++ b/gcc/testsuite/obj-c++.dg/proto-qual-1.mm @@ -3,12 +3,14 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Protocol1.h" + +#include <stdio.h> +#include <stdlib.h> #ifndef __NEXT_RUNTIME__ #include <objc/objc-api.h> #endif -#include <stdio.h> -#include <stdlib.h> +#include "../objc-obj-c++-shared/next-mapping.h" +#include <objc/Protocol.h> /* The encoded parameter sizes will be rounded up to match pointer alignment. */ #define ROUND(s,a) (a * ((s + a - 1) / a)) @@ -30,8 +32,11 @@ - (bycopy) address:(byref inout id)location with:(out short unsigned **)arg2 { return nil; } @end -Protocol *proto = @protocol(Retain); +Protocol *proto; struct objc_method_description *meth; +#ifdef NEXT_OBJC_USE_NEW_INTERFACE +struct objc_method_description meth_object; +#endif unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7; static void scan_initial(const char *pattern) { @@ -42,10 +47,23 @@ static void scan_initial(const char *pattern) { } int main(void) { + proto = @protocol(Retain); +#ifdef NEXT_OBJC_USE_NEW_INTERFACE + meth_object = protocol_getMethodDescription (proto, @selector(address:with:), + YES, YES); + meth = &meth_object; +#else meth = [proto descriptionForInstanceMethod: @selector(address:with:)]; +#endif scan_initial("O@%u@%u:%uNR@%uo^^S%u"); CHECK_IF(offs3 == offs2 + aligned_sizeof(id) && totsize == offs3 + aligned_sizeof(unsigned)); +#ifdef NEXT_OBJC_USE_NEW_INTERFACE + meth_object = protocol_getMethodDescription (proto, @selector(retainArgument:with:), + YES, NO); + meth = &meth_object; +#else meth = [proto descriptionForClassMethod: @selector(retainArgument:with:)]; +#endif scan_initial("Vv%u@%u:%uOo@%un^*%u"); CHECK_IF(offs3 == offs2 + aligned_sizeof(id) && totsize == offs3 + aligned_sizeof(char **)); return 0; |