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/Chapter7 | |
| 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/Chapter7')
| -rw-r--r-- | llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | llvm/examples/Kaleidoscope/Chapter7/toy.cpp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt b/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt index 27c18cdd065..e67d7928efe 100644 --- a/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt +++ b/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt @@ -13,3 +13,5 @@ set(LLVM_LINK_COMPONENTS add_kaleidoscope_chapter(Kaleidoscope-Ch7 toy.cpp ) + +export_executable_symbols(Kaleidoscope-Ch7) diff --git a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp index 4558522952c..d61d880e540 100644 --- a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp @@ -1189,14 +1189,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; } |

