~ubuntu-branches/ubuntu/precise/ghc/precise

« back to all changes in this revision

Viewing changes to driver/test_mangler

  • Committer: Bazaar Package Importer
  • Author(s): Joachim Breitner
  • Date: 2011-01-17 12:49:24 UTC
  • Revision ID: james.westby@ubuntu.com-20110117124924-do1pym1jlf5o636m
Tags: upstream-7.0.1
ImportĀ upstreamĀ versionĀ 7.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/perl
 
2
# a simple wrapper to test a .s-file mangler
 
3
# reads stdin, writes stdout
 
4
 
 
5
push(@INC,"/net/dazdak/BUILDS/gransim-4.04/i386-unknown-linux/ghc/driver");
 
6
 
 
7
$TargetPlatform = $ARGV[0]; shift; # nice error checking, Will
 
8
 
 
9
require("ghc-asm.prl") || die "require mangler failed!\n";
 
10
 
 
11
$SpX86Mangling = 1;
 
12
$StolenX86Regs = 4;
 
13
 
 
14
open(INP, "> /tmp/mangle1.$$") || die "Can't open tmp file 1\n";
 
15
while (<>) {
 
16
    print INP $_;
 
17
}
 
18
close(INP) || die "Can't close tmp file 1";
 
19
 
 
20
&mangle_asm("/tmp/mangle1.$$", "/tmp/mangle2.$$");
 
21
 
 
22
open(INP, "< /tmp/mangle2.$$") || die "Can't open tmp file 2\n";
 
23
while (<INP>) {
 
24
    print STDOUT $_;
 
25
}
 
26
close(INP) || die "Can't close tmp file 2";
 
27
 
 
28
unlink("/tmp/mangle1.$$", "/tmp/mangle2.$$");
 
29
exit(0);