diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-11-25 17:40:00 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-11-25 09:40:00 -0800 |
commit | 78a34a875a002504f1ecdd396f1f320ef60e5db7 (patch) | |
tree | 3e6070d87dad5200eaeafa0c776c9287a12c2793 | |
parent | ca146b8fdf158dac07f949dc9b99107570d5f527 (diff) | |
download | gcc-78a34a875a002504f1ecdd396f1f320ef60e5db7.zip gcc-78a34a875a002504f1ecdd396f1f320ef60e5db7.tar.gz gcc-78a34a875a002504f1ecdd396f1f320ef60e5db7.tar.bz2 |
gnu-runtime-3.m: New test.
2005-11-25 Andrew Pinski <pinskia@physics.uc.edu>
* objc.dg/gnu-runtime-3.m: New test.
From-SVN: r107512
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/gnu-runtime-3.m | 30 |
2 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 35d0b51..054ea9a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-11-25 Andrew Pinski <pinskia@physics.uc.edu> + + * objc.dg/gnu-runtime-3.m: New test. + 2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de> PR c++/9278 diff --git a/gcc/testsuite/objc.dg/gnu-runtime-3.m b/gcc/testsuite/objc.dg/gnu-runtime-3.m new file mode 100644 index 0000000..09204e3 --- /dev/null +++ b/gcc/testsuite/objc.dg/gnu-runtime-3.m @@ -0,0 +1,30 @@ +/* Sanity check for GNU-runtime version of constant strings, + regardless of runtime used on target system. */ + +/* { dg-do run } */ +/* { dg-options "-fgnu-runtime" } */ + +#include <objc/Object.h> +#include <string.h> +#include <stdlib.h> + +@interface NXConstantString: Object +{ + char *c_string; + unsigned int len; +} +-(const char *) cString; +-(unsigned int) length; +@end + +@implementation NXConstantString +-(const char *) cString { return c_string; } +-(unsigned int) length { return len; } +@end + +int main(int argc, void **args) +{ + if (strcmp ([@"this is a string" cString], "this is a string")) + abort (); + return 0; +} |