perl 1.0 patch 1: Portability bugs and one possible SIGSEGV
[p5sagit/p5-mst-13.2.git] / t / comp.cpp
CommitLineData
8d063cd8 1#!./perl -P
2
3# $Header: comp.cpp,v 1.0 87/12/18 13:12:22 root Exp $
4
5print "1..3\n";
6
7#this is a comment
8#define MESS "ok 1\n"
9print MESS;
10
11#If you capitalize, it's a comment.
12#ifdef MESS
13 print "ok 2\n";
14#else
15 print "not ok 2\n";
16#endif
17
18open(try,">Comp.cpp.tmp") || die "Can't open temp perl file.";
19print try '$ok = "not ok 3\n";'; print try "\n";
20print try "#include <Comp.cpp.inc>\n";
21print try "#ifdef OK\n";
22print try '$ok = OK;'; print try "\n";
23print try "#endif\n";
24print try 'print $ok;'; print try "\n";
25close try;
26
27open(try,">Comp.cpp.inc") || (die "Can't open temp include file.");
28print try '#define OK "ok 3\n"'; print try "\n";
29close try;
30
31$pwd=`pwd`;
32$pwd =~ s/\n//;
33$x = `./perl -P -I$pwd Comp.cpp.tmp`;
34print $x;
35`/bin/rm -f Comp.cpp.tmp Comp.cpp.inc`;