1 //===-- stacker_rt.c - Runtime Suppor For Stacker Compiler ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Reid Spencer and donated to the LLVM research
6 // group and is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 // This file defines a stack dumping function that can be used for debugging.
12 // It is called whenever the DUMP built-in word is used in the Stacker source.
13 // It has no effect on the stack (other than to print it).
15 // The real reason this is here is to test LLVM's ability to link with
16 // separately compiled software.
18 //===----------------------------------------------------------------------===//
23 extern int _stack_[1024];
26 _stacker_dump_stack_()
29 printf("Stack Dump:\n");
30 for (i = _index_; i > 0; i-- )
32 printf("#%03d: %d\n", i, _stack_[i] );