diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-08-14 01:33:13 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-08-13 18:33:13 -0700 |
commit | 65045c09038446c48783fe7e30134d72c131a0b1 (patch) | |
tree | 98bb2d90171c8882e018912e0aab20712d3a95ad /gcc/testsuite/objc/execute | |
parent | d3748cf565829b1db471ba7a246e382231b95c66 (diff) | |
download | gcc-65045c09038446c48783fe7e30134d72c131a0b1.zip gcc-65045c09038446c48783fe7e30134d72c131a0b1.tar.gz gcc-65045c09038446c48783fe7e30134d72c131a0b1.tar.bz2 |
nested-func-1.m: Move to ...
2005-08-13 Andrew Pinski <pinskia@physics.uc.edu>
* objc.dg/nested-func-1.m: Move to ...
* objc/execute/nested-func-1.m: Here.
From-SVN: r103072
Diffstat (limited to 'gcc/testsuite/objc/execute')
-rw-r--r-- | gcc/testsuite/objc/execute/nested-func-1.m | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/objc/execute/nested-func-1.m b/gcc/testsuite/objc/execute/nested-func-1.m new file mode 100644 index 0000000..c7dd535 --- /dev/null +++ b/gcc/testsuite/objc/execute/nested-func-1.m @@ -0,0 +1,36 @@ +/* Test basic nested C function functionality within ObjC + methods. */ +/* Contributed by Ziemowit Laski <zlaski@apple.com>. */ +#include <stdio.h> +#include <stdlib.h> +#include <objc/objc.h> +#include <objc/Object.h> + +int bappy (int (*blargh) (int a, int b, int c)) +{ + return blargh (4, 7, 2) + 3; +} + +@interface Foo: Object ++ (int)foo; +@end + +@implementation Foo ++ (int)foo +{ + int blargh (int a, int b, int c) + { + return a * b + c; + } + return bappy (blargh); +} +@end + +int main () +{ + int f = [Foo foo]; + if (f != 33) + abort (); + + return 0; +} |