diff options
author | Lang Hames <lhames@gmail.com> | 2015-08-27 20:31:44 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2015-08-27 20:31:44 +0000 |
commit | d76e06715056710199bb74b4582e9c343a252aeb (patch) | |
tree | 2b38d78b6a77bbf4c08f576a8844583cef78f61d /llvm/examples/Kaleidoscope/Chapter4/toy.cpp | |
parent | a79dfb3223289498498f695e0b2d248031b00766 (diff) | |
download | bcm5719-llvm-d76e06715056710199bb74b4582e9c343a252aeb.tar.gz bcm5719-llvm-d76e06715056710199bb74b4582e9c343a252aeb.zip |
Recommit r246175 - Add Kaleidoscope regression tests, with a fix to make sure
the kaleidoscope 'library' functions aren't dead-stripped in release builds.
llvm-svn: 246201
Diffstat (limited to 'llvm/examples/Kaleidoscope/Chapter4/toy.cpp')
-rw-r--r-- | llvm/examples/Kaleidoscope/Chapter4/toy.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp b/llvm/examples/Kaleidoscope/Chapter4/toy.cpp index 12777ae2c75..fe8ec17b4e8 100644 --- a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter4/toy.cpp @@ -631,14 +631,14 @@ static void MainLoop() { //===----------------------------------------------------------------------===// /// putchard - putchar that takes a double and returns 0. -extern "C" double putchard(double X) { - putchar((char)X); +__attribute__((used)) extern "C" double putchard(double X) { + fputc((char)X, stderr); return 0; } /// printd - printf that takes a double prints it as "%f\n", returning 0. -extern "C" double printd(double X) { - printf("%f\n", X); +__attribute__((used)) extern "C" double printd(double X) { + fprintf(stderr, "%f\n", X); return 0; } |