diff options
author | Lang Hames <lhames@gmail.com> | 2015-08-27 18:13:34 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2015-08-27 18:13:34 +0000 |
commit | b325a1ace53c1f0b1b38505fefeb08114f40dc10 (patch) | |
tree | ab62639f1f02696b1bfd37cea626b6df495fc3b4 /examples | |
parent | 2b96ce62f49d4701bc9880e27ebc894a371342e2 (diff) |
Add Kaleidoscope regression tests.
These will be run if LLVM_BUILD_EXAMPLES is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Kaleidoscope/Chapter4/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter4/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter5/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter5/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter6/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter6/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter7/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter7/toy.cpp | 4 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter8/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter8/toy.cpp | 4 |
10 files changed, 20 insertions, 10 deletions
diff --git a/examples/Kaleidoscope/Chapter4/CMakeLists.txt b/examples/Kaleidoscope/Chapter4/CMakeLists.txt index 44e1aeecaae..89feed143ad 100644 --- a/examples/Kaleidoscope/Chapter4/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter4/CMakeLists.txt @@ -13,3 +13,5 @@ set(LLVM_LINK_COMPONENTS add_kaleidoscope_chapter(Kaleidoscope-Ch4 toy.cpp ) + +export_executable_symbols(Kaleidoscope-Ch4) diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp index 12777ae2c75..c102784b531 100644 --- a/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/examples/Kaleidoscope/Chapter4/toy.cpp @@ -632,13 +632,13 @@ static void MainLoop() { /// putchard - putchar that takes a double and returns 0. extern "C" double putchard(double X) { - putchar((char)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); + fprintf(stderr, "%f\n", X); return 0; } diff --git a/examples/Kaleidoscope/Chapter5/CMakeLists.txt b/examples/Kaleidoscope/Chapter5/CMakeLists.txt index b62ed410103..c0ae70654c3 100644 --- a/examples/Kaleidoscope/Chapter5/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter5/CMakeLists.txt @@ -13,3 +13,5 @@ set(LLVM_LINK_COMPONENTS add_kaleidoscope_chapter(Kaleidoscope-Ch5 toy.cpp ) + +export_executable_symbols(Kaleidoscope-Ch5) diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp index 83af1776b20..29db71c20a8 100644 --- a/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/examples/Kaleidoscope/Chapter5/toy.cpp @@ -906,13 +906,13 @@ static void MainLoop() { /// putchard - putchar that takes a double and returns 0. extern "C" double putchard(double X) { - putchar((char)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); + fprintf(stderr, "%f\n", X); return 0; } diff --git a/examples/Kaleidoscope/Chapter6/CMakeLists.txt b/examples/Kaleidoscope/Chapter6/CMakeLists.txt index 6bb2b193752..49627f07ddf 100644 --- a/examples/Kaleidoscope/Chapter6/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter6/CMakeLists.txt @@ -13,3 +13,5 @@ set(LLVM_LINK_COMPONENTS add_kaleidoscope_chapter(Kaleidoscope-Ch6 toy.cpp ) + +export_executable_symbols(Kaleidoscope-Ch6) diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index e1bed45189e..8f802384d1d 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -1024,13 +1024,13 @@ static void MainLoop() { /// putchard - putchar that takes a double and returns 0. extern "C" double putchard(double X) { - putchar((char)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); + fprintf(stderr, "%f\n", X); return 0; } diff --git a/examples/Kaleidoscope/Chapter7/CMakeLists.txt b/examples/Kaleidoscope/Chapter7/CMakeLists.txt index 27c18cdd065..e67d7928efe 100644 --- a/examples/Kaleidoscope/Chapter7/CMakeLists.txt +++ b/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/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp index 4558522952c..be00f873e6d 100644 --- a/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/examples/Kaleidoscope/Chapter7/toy.cpp @@ -1190,13 +1190,13 @@ static void MainLoop() { /// putchard - putchar that takes a double and returns 0. extern "C" double putchard(double X) { - putchar((char)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); + fprintf(stderr, "%f\n", X); return 0; } diff --git a/examples/Kaleidoscope/Chapter8/CMakeLists.txt b/examples/Kaleidoscope/Chapter8/CMakeLists.txt index e335cb48ac7..d9b5cc421be 100644 --- a/examples/Kaleidoscope/Chapter8/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter8/CMakeLists.txt @@ -9,3 +9,5 @@ set(LLVM_LINK_COMPONENTS add_kaleidoscope_chapter(Kaleidoscope-Ch8 toy.cpp ) + +export_executable_symbols(Kaleidoscope-Ch8) diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp index 7338c6ebc50..b78d901db2d 100644 --- a/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/examples/Kaleidoscope/Chapter8/toy.cpp @@ -1384,13 +1384,13 @@ static void MainLoop() { /// putchard - putchar that takes a double and returns 0. extern "C" double putchard(double X) { - putchar((char)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); + fprintf(stderr, "%f\n", X); return 0; } |