This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge maint-5.004 branch (5.004_04) with mainline.
[perl5.git] / t / comp / cpp.aux
CommitLineData
16d20bd9
AD
1#!./perl -P
2
3# $RCSfile: cpp.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:18 $
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.";
19
20($prog = <<'END') =~ s/X//g;
21X$ok = "not ok 3\n";
22X#include "Comp.cpp.inc"
23X#ifdef OK
24X$ok = OK;
25X#endif
26Xprint $ok;
27END
28print TRY $prog;
29close TRY;
30
31open(TRY,">Comp.cpp.inc") || (die "Can't open temp include file.");
32print TRY '#define OK "ok 3\n"' . "\n";
33close TRY;
34
35$pwd=`pwd`;
36$pwd =~ s/\n//;
37$x = `./perl -P Comp.cpp.tmp`;
38print $x;
39unlink "Comp.cpp.tmp", "Comp.cpp.inc";