summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/T17920.cmm
blob: 2cfe5eb92a54934bbbc96889526bb35c9086ec65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "Cmm.h"

section "rodata" { msg : bits8[] "Test\n"; }
section "data" { faketso : bits8[1000]; }

stg_myExit {
   foreign "C" stg_exit(0);
}

stg_foo {
  
   BaseReg = faketso;

   SAVE_REGS();

   foreign "C" printf(msg "ptr");

   RESTORE_REGS();

   jump stg_myExit [*]; // all registers live
}

INFO_TABLE_CONSTR(ZCMain_main,0,0,0,CONSTR_NOCAF,"MAIN","MAIN")
{
   jump stg_foo [];
}

CLOSURE(ZCMain_main_closure,ZCMain_main);