Index: MANIFEST
===================================================================
--- MANIFEST	(revision 15026)
+++ MANIFEST	(working copy)
@@ -2453,6 +2453,7 @@
 t/codingstd/fixme.t                                         []
 t/codingstd/linelength.t                                    []
 t/codingstd/perlcritic.t                                    []
+t/codingstd/returns.t                                       []
 t/codingstd/tabs.t                                          []
 t/codingstd/trailing_space.t                                []
 t/compilers/imcc/imcpasm/cfg.t                              []
Index: t/codingstd/returns.t
===================================================================
--- t/codingstd/returns.t	(revision 0)
+++ t/codingstd/returns.t	(revision 0)
@@ -0,0 +1,93 @@
+#! perl
+# Copyright (C) 2006, The Perl Foundation.
+# $Id$
+
+use strict;
+use warnings;
+
+use lib qw( . lib ../lib ../../lib );
+use Test::More tests => 1;
+use Parrot::Distribution;
+
+=head1 NAME
+
+t/codingstd/returns.t - checks for possible use of C<return (foo);> from functions
+
+=head1 SYNOPSIS
+
+    # test all files
+    % prove t/codingstd/returns.t
+
+    # test specific files
+    % perl t/codingstd/returns.t src/foo.c include/parrot/bar.h
+
+=head1 DESCRIPTION
+
+Checks that all C language source files return using C<return foo;> rather
+than C<return (foo);>
+
+=head1 NOTES
+
+This test was hacked from the C<check_returns> sub in 
+C<tools/dev/check_source_standards.pl>
+
+=head1 SEE ALSO
+
+L<docs/pdds/pdd07_codingstd.pod>
+
+=cut
+
+my $DIST = Parrot::Distribution->new;
+my @files = @ARGV ? @ARGV : source_files();
+my @paren_return;
+
+foreach my $file (@files) {
+    my $buf;
+    my $path;
+
+    ## get the full path of the file
+    # if we have command line arguments, the file is the full path
+    if (@ARGV) {
+        $path = $file;
+    }
+
+    # otherwise, use the relevant Parrot:: path method
+    else {
+        $path = $file->path;
+    }
+
+    # slurp in the file
+    open( my $fh, '<', $path )
+        or die "Cannot open '$path' for reading: $!\n";
+    {
+        local $/;
+        $buf = <$fh>;
+    }
+
+    # look for instances of return(
+    push @paren_return => "$path\n"
+        if ($buf =~ m/return\(/);
+}
+
+ok( !scalar(@paren_return), 'Correctly formed return statement' )
+    or diag( "Possible use of C<return(foo);> rather than C<return foo;> in " . 
+        scalar @paren_return . " files:\n@paren_return" );
+
+exit;
+
+sub source_files {
+    return (
+        map( $_->files_of_type('C code'),   $DIST->c_source_file_directories ),
+        map( $_->files_of_type('C header'), $DIST->c_header_file_directories ),
+        map( $_->files_of_type('PMC code'), $DIST->pmc_source_file_directories ),
+        map( $_->files_of_type('Yacc file'), $DIST->yacc_source_file_directories ),
+        map( $_->files_of_type('Lex file'), $DIST->lex_source_file_directories ),
+    );
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
