This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test that entries in %^H are actually independant.
[perl5.git] / t / comp / cpp.aux
CommitLineData
1b24ed4b
MS
1#!./perl -l
2
3# There's a bug in -P where the #! line is ignored. If this test
4# suddenly starts printing blank lines that bug has been fixed.
16d20bd9 5
16d20bd9
AD
6print "1..3\n";
7
16d20bd9
AD
8#define MESS "ok 1\n"
9print MESS;
10
16d20bd9
AD
11#ifdef MESS
12 print "ok 2\n";
13#else
14 print "not ok 2\n";
15#endif
16
1b24ed4b 17open(TRY,">Comp_cpp.tmp") || die "Can't open temp perl file: $!";
16d20bd9
AD
18
19($prog = <<'END') =~ s/X//g;
20X$ok = "not ok 3\n";
1b24ed4b 21X#include "Comp_cpp.inc"
16d20bd9
AD
22X#ifdef OK
23X$ok = OK;
24X#endif
25Xprint $ok;
26END
27print TRY $prog;
d1e4d418 28close TRY or die "Could not close Comp_cpp.tmp: $!";
16d20bd9 29
1b24ed4b 30open(TRY,">Comp_cpp.inc") || (die "Can't open temp include file: $!");
16d20bd9 31print TRY '#define OK "ok 3\n"' . "\n";
d1e4d418 32close TRY or die "Could not close Comp_cpp.tmp: $!";
16d20bd9 33
1b24ed4b
MS
34print `$^X "-P" Comp_cpp.tmp`;
35unlink "Comp_cpp.tmp", "Comp_cpp.inc";