llvm.org GIT mirror llvm / 38941a6
Revert r246175 to get builder green again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246185 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 4 years ago
21 changed file(s) with 11 addition(s) and 128 deletion(s). Raw diff Collapse all Expand all
565565
566566 /// putchard - putchar that takes a double and returns 0.
567567 extern "C" double putchard(double X) {
568 fputc((char)X, stderr);
568 putchar((char)X);
569569 return 0;
570570 }
571571
1212 add_kaleidoscope_chapter(Kaleidoscope-Ch4
1313 toy.cpp
1414 )
15
16 export_executable_symbols(Kaleidoscope-Ch4)
631631
632632 /// putchard - putchar that takes a double and returns 0.
633633 extern "C" double putchard(double X) {
634 fputc((char)X, stderr);
634 putchar((char)X);
635635 return 0;
636636 }
637637
638638 /// printd - printf that takes a double prints it as "%f\n", returning 0.
639639 extern "C" double printd(double X) {
640 fprintf(stderr, "%f\n", X);
640 printf("%f\n", X);
641641 return 0;
642642 }
643643
1212 add_kaleidoscope_chapter(Kaleidoscope-Ch5
1313 toy.cpp
1414 )
15
16 export_executable_symbols(Kaleidoscope-Ch5)
905905
906906 /// putchard - putchar that takes a double and returns 0.
907907 extern "C" double putchard(double X) {
908 fputc((char)X, stderr);
908 putchar((char)X);
909909 return 0;
910910 }
911911
912912 /// printd - printf that takes a double prints it as "%f\n", returning 0.
913913 extern "C" double printd(double X) {
914 fprintf(stderr, "%f\n", X);
914 printf("%f\n", X);
915915 return 0;
916916 }
917917
1212 add_kaleidoscope_chapter(Kaleidoscope-Ch6
1313 toy.cpp
1414 )
15
16 export_executable_symbols(Kaleidoscope-Ch6)
10231023
10241024 /// putchard - putchar that takes a double and returns 0.
10251025 extern "C" double putchard(double X) {
1026 fputc((char)X, stderr);
1026 putchar((char)X);
10271027 return 0;
10281028 }
10291029
10301030 /// printd - printf that takes a double prints it as "%f\n", returning 0.
10311031 extern "C" double printd(double X) {
1032 fprintf(stderr, "%f\n", X);
1032 printf("%f\n", X);
10331033 return 0;
10341034 }
10351035
1212 add_kaleidoscope_chapter(Kaleidoscope-Ch7
1313 toy.cpp
1414 )
15
16 export_executable_symbols(Kaleidoscope-Ch7)
11891189
11901190 /// putchard - putchar that takes a double and returns 0.
11911191 extern "C" double putchard(double X) {
1192 fputc((char)X, stderr);
1192 putchar((char)X);
11931193 return 0;
11941194 }
11951195
11961196 /// printd - printf that takes a double prints it as "%f\n", returning 0.
11971197 extern "C" double printd(double X) {
1198 fprintf(stderr, "%f\n", X);
1198 printf("%f\n", X);
11991199 return 0;
12001200 }
12011201
88 add_kaleidoscope_chapter(Kaleidoscope-Ch8
99 toy.cpp
1010 )
11
12 export_executable_symbols(Kaleidoscope-Ch8)
13831383
13841384 /// putchard - putchar that takes a double and returns 0.
13851385 extern "C" double putchard(double X) {
1386 fputc((char)X, stderr);
1386 putchar((char)X);
13871387 return 0;
13881388 }
13891389
13901390 /// printd - printf that takes a double prints it as "%f\n", returning 0.
13911391 extern "C" double printd(double X) {
1392 fprintf(stderr, "%f\n", X);
1392 printf("%f\n", X);
13931393 return 0;
13941394 }
13951395
None if(LLVM_BUILD_EXAMPLES)
1 set(ENABLE_EXAMPLES 1)
2 endif()
3
4 configure_lit_site_cfg(
51 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
62 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
9995 )
10096 endif()
10197
102 if(LLVM_BUILD_EXAMPLES)
103 list(APPEND LLVM_TEST_DEPENDS
104 Kaleidoscope-Ch3
105 Kaleidoscope-Ch4
106 Kaleidoscope-Ch5
107 Kaleidoscope-Ch6
108 Kaleidoscope-Ch7
109 )
110 endif()
111
11298 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
11399 ${CMAKE_CURRENT_BINARY_DIR}
114100 PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+0
-17
test/Examples/Kaleidoscope/Chapter3.test less more
None # RUN: Kaleidoscope-Ch3 < %s 2>&1 | FileCheck %s
1
2 # Test basic parsing and IR generation.
3 def foo(x) x + 1;
4 foo(1);
5
6 # CHECK: define double @foo(double %x) {
7 # CHECK-NEXT: entry:
8 # CHECK-NEXT: %addtmp = fadd double %x, 1.000000e+00
9 # CHECK-NEXT: ret double %addtmp
10 # CHECK-NEXT: }
11
12 # CHECK: define double @__anon_expr() {
13 # CHECK-NEXT: entry:
14 # CHECK-NEXT: %calltmp = call double @foo(double 1.000000e+00)
15 # CHECK-NEXT: ret double %calltmp
16 # CHECK-NEXT: }
+0
-17
test/Examples/Kaleidoscope/Chapter4.test less more
None # RUN: Kaleidoscope-Ch4 < %s 2>&1 | FileCheck %s
1
2 # Test basic definition, binding, and execution.
3 def foo(x) x + 1;
4 def bar(x) foo(2 * x);
5 bar(2);
6 # CHECK: Evaluated to 5.000000
7
8 # Test redefinition.
9 def foo(x) x + 2;
10 foo(2);
11 # CHECK: Evaluated to 4.000000
12
13 # Verify that 'bar' still calls the original 'foo'.
14 bar(2);
15 # CHECK: Evaluated to 5.000000
16
+0
-19
test/Examples/Kaleidoscope/Chapter5.test less more
None # RUN: Kaleidoscope-Ch5 < %s 2>&1 | FileCheck %s
1
2 # Test 'if' expression.
3 def foo(x) if x < 10 then 0 else 1;
4 foo(9);
5 foo(11);
6 # CHECK: Evaluated to 0.000000
7 # CHECK: Evaluated to 1.000000
8
9 # Test 'for' expression.
10 extern printd(x);
11 for i = 1, i < 5, 1.0 in
12 printd(i);
13 # CHECK: 1.0
14 # CHECK: 2.0
15 # CHECK: 3.0
16 # CHECK: 4.0
17 # CHECK: 5.0
18 # CHECK: Evaluated to 0.000000
+0
-15
test/Examples/Kaleidoscope/Chapter6.test less more
None # RUN: Kaleidoscope-Ch6 < %s 2>&1 | FileCheck %s
1
2 # Test unary operator definition.
3 def unary-(x) 0 - x;
4 1 + (-1);
5 # CHECK: Evaluated to 0.000000
6
7 # Test binary operator definition.
8 def binary> 10 (lhs rhs) rhs < lhs;
9 def foo(x) if x > 10 then 0 else 1;
10 foo(9);
11 foo(11);
12 # CHECK: Evaluated to 1.000000
13 # CHECK: Evaluated to 0.000000
14
+0
-15
test/Examples/Kaleidoscope/Chapter7.test less more
None # RUN: Kaleidoscope-Ch7 < %s 2>&1 | FileCheck %s
1
2 # Sequence operator and iterative fibonacci function to test user defined vars.
3 def binary : 1 (x y) y;
4
5 def fibi(x)
6 var a = 1, b = 1, c in
7 (for i = 3, i < x in
8 c = a + b :
9 a = b :
10 b = c) :
11 b;
12
13 fibi(10);
14 # CHECK: Evaluated to 55.000000
+0
-2
test/Examples/lit.local.cfg less more
None if not config.test_examples:
1 config.unsupported = True
145145 @$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
146146 @$(ECHOPATH) s=@HAVE_LIBZ@=$(HAVE_LIBZ)=g >> lit.tmp
147147 @$(ECHOPATH) s=@HAVE_DIA_SDK@=0=g >> lit.tmp
148 @$(ECHOPATH) s=@ENABLE_EXAMPLES@=$(BUILD_EXAMPLES)=g >> lit.tmp
149148 @sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
150149 @-rm -f lit.tmp
151150
257257 r"\byaml2obj\b",
258258 r"\byaml-bench\b",
259259 r"\bverify-uselistorder\b",
260 r"\bKaleidoscope-Ch3\b",
261 r"\bKaleidoscope-Ch4\b",
262 r"\bKaleidoscope-Ch5\b",
263 r"\bKaleidoscope-Ch6\b",
264 r"\bKaleidoscope-Ch7\b",
265 r"\bKaleidoscope-Ch8\b",
266260 # Handle these specially as they are strings searched
267261 # for during testing.
268262 r"\| \bcount\b",
3434 config.have_zlib = "@HAVE_LIBZ@"
3535 config.have_dia_sdk = @HAVE_DIA_SDK@
3636 config.enable_ffi = "@LLVM_ENABLE_FFI@"
37 config.test_examples = "@ENABLE_EXAMPLES@"
3837
3938 # Support substitution of the tools_dir with user parameters. This is
4039 # used when we can't determine the tool dir at configuration time.