Lines Matching +full:valgrind +full:- +full:out

2  * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2018-2025 Gavin D. Howard and contributors.
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 DEFOPT: str = if WINDOWS { "/D"; } else { "-D"; };
37 C11OPT: str = if WINDOWS { "/std:c11"; } else { "-std=c11"; };
38 C99OPT: str = if WINDOWS { "/std:c99"; } else { "-std=c99"; };
46 fn strv2str(arr: []str) -> str
69 "Usage: ", $PROG, " [-h|--help] [<options> \n"
73 help: "Turn off building and testing 64-bit builds."
74 long: @no-64
78 help: "Turn off building and testing builds with 128-bit integers."
79 long: @no-128
85 long: @no-clang
90 long: @no-c11
96 long: @no-gcc
102 long: @no-gen-script
107 long: @no-make
112 long: @no-rig
118 long: @no-tests
121 computed-goto: {
123 long: @computed-goto
152 long: @problematic-tests
173 help: "Whether to run under Valgrind or not."
175 long: @valgrind
181 // These are the booleans for the command-line flags.
200 valgrind: !bool = false;
205 cgoto_flags: []str = if !computed_goto { @[ "-DBC_NO_COMPUTED_GOTO" ]; };
207 // Set some strict warning flags. Clang's -Weverything can be way too strict, so
209 CLANG_FLAGS: []str = @[ "-Weverything", "-Wno-padded",
210 "-Wno-unsafe-buffer-usage",
211 "-Wno-poison-system-directories",
212 "-Wno-switch-default", "-Wno-unknown-warning-option",
213 "-Wno-pre-c11-compat" ] +~ cgoto_flags;
214 GCC_FLAGS: []str = @[ "-Wno-clobbered" ] +~ cgoto_flags;
221 CFLAGS: []str = @[ "-Wall", "-Wextra", "-Werror", "-pedantic" ];
226 DEBUG_CFLAGS: []str = CFLAGS +~ @[ "-fno-omit-frame-pointer" ];
227 DEBUG_CFLAGS_STR: str = CFLAGS_STR +~ " -fno-omit-frame-pointer";
228 RELEASE_CFLAGS: []str = CFLAGS +~ @[ "-DNDEBUG" ];
229 RELEASE_CFLAGS_STR: str = CFLAGS_STR +~ " -DNDEBUG";
236 fn header(msg: str) -> void
247 fn do_make(args: []str) -> void
249 $ make -j64 %(args);
256 fn do_rig(args: []str) -> void
258 $ rig -j64 %(args);
275 ) -> void
285 if !problematic { "-GP"; } else { "-G"; }
289 "-P";
298 CLANG_FLAGS_STR +~ (if !gen_host { " -Wno-overlength-strings"; });
305 GCC_FLAGS_STR +~ (if !gen_host { "-Wno-overlength-strings"; });
346 ) -> void
391 ) -> void
425 fn run_test_make(args: []str) -> void
453 fn run_test_rig(args: []str) -> void
492 ) -> void
524 build_make(cflags, cc, flags +~ " -b", gen, long_bit);
533 build_make(cflags, cc, flags +~ " -d", gen, long_bit);
556 ) -> void
588 build_rig(cflags, cc, flags +~ @[ "-Dbuild_mode=bc" ], long_bit);
597 build_rig(cflags, cc, flags +~ @[ "-Dbuild_mode=dc" ], long_bit);
619 ) -> void
646 cc, flags +~ " -e", true, usize(64));
654 cc, flags +~ " -r", true, usize(64));
678 ) -> void
696 if editline && !(flags contains "-Dhistory=none")
699 cc, flags +~ @[ "-Dhistory=editline" ],
704 if readline && !(flags contains "-Dhistory=none")
707 cc, flags +~ @[ "-Dhistory=readline" ],
726 ) -> void
761 ) -> void
802 ) -> void
815 run_settings_series_make(cflags, cc, flags +~ " -" +~ sflag);
830 ) -> void
866 ) -> void
873 build_make(cflags +~ " -a", cc, flags, true, usize(64));
880 build_make(cflags +~ " -a", cc, flags, true, usize(32));
899 ) -> void
906 build_rig(cflags, cc, flags +~ @[ "-Dbuild_mode=library" ], usize(64));
913 build_rig(cflags, cc, flags +~ @[ "-Dbuild_mode=library" ], usize(32));
932 ) -> void
958 ) -> void
976 fn karatsuba_make() -> void
991 fn karatsuba_rig() -> void
1000 build_rig(RELEASE_CFLAGS, defcc, @[ "-O3" ], usize(64));
1006 * Builds with `make` and runs under valgrind. It runs both, bc only, then dc
1009 fn vg_make() -> void
1016 header("Running Valgrind under `make`");
1018 build_make(DEBUG_CFLAGS_STR +~ " -std=c99", "gcc", "-O3 -gv", true,
1024 build_make(DEBUG_CFLAGS_STR +~ " -std=c99", "gcc", "-O3 -gvb", true,
1030 build_make(DEBUG_CFLAGS_STR +~ " -std=c99", "gcc", "-O3 -gvd", true,
1036 build_make(DEBUG_CFLAGS_STR +~ " -std=c99", "gcc", "-O3 -gva", true,
1043 fn vg_rig() -> void
1050 header("Running Valgrind under Rig");
1052 build_rig(DEBUG_CFLAGS +~ @[ "-std=c99" ], "gcc", @[ "-O3", "-gv" ],
1058 build_rig(DEBUG_CFLAGS +~ @[ "-std=c99" ], "gcc", @[ "-O3", "-gvb" ],
1064 build_rig(DEBUG_CFLAGS +~ @[ "-std=c99" ], "gcc", @[ "-O3", "-gvd" ],
1070 build_rig(DEBUG_CFLAGS +~ @[ "-std=c99" ], "gcc", @[ "-O3", "-gva" ],
1083 ) -> void
1092 run_tests_make(DEBUG_CFLAGS_STR +~ " -fsanitize=undefined", cc, "-mg");
1096 run_tests_make(DEBUG_CFLAGS_STR, cc, "-g");
1106 ) -> void
1113 run_tests_make(RELEASE_CFLAGS_STR, cc, "-O3");
1114 run_lib_tests_make(RELEASE_CFLAGS_STR, cc, "-O3");
1124 ) -> void
1133 run_tests_make(DEBUG_CFLAGS_STR +~ " -fsanitize=address", cc, "-mgO3");
1134 run_tests_make(DEBUG_CFLAGS_STR +~ " -fsanitize=memory", cc, "-mgO3");
1138 run_tests_make(DEBUG_CFLAGS_STR, cc, "-gO3");
1143 run_lib_tests_make(DEBUG_CFLAGS_STR +~ " -fsanitize=address", cc,
1144 "-mgO3");
1145 run_lib_tests_make(DEBUG_CFLAGS_STR +~ " -fsanitize=memory", cc,
1146 "-mgO3");
1150 run_lib_tests_make(DEBUG_CFLAGS_STR, cc, "-gO3");
1160 ) -> void
1167 run_tests_make(RELEASE_CFLAGS_STR, cc, "-Os");
1168 run_lib_tests_make(RELEASE_CFLAGS_STR, cc, "-Os");
1178 ) -> void
1195 if valgrind
1207 ) -> void
1216 run_tests_rig(DEBUG_CFLAGS +~ @[ " -fsanitize=undefined" ], cc,
1217 @[ "-Dmemcheck=1", "-Ddebug=1" ]);
1221 run_tests_rig(DEBUG_CFLAGS, cc, @[ "-Ddebug=1" ]);
1231 ) -> void
1238 run_tests_rig(RELEASE_CFLAGS, cc, @[ "-Doptimization=3" ]);
1239 run_lib_tests_rig(RELEASE_CFLAGS, cc, @[ "-Doptimization=3" ]);
1249 ) -> void
1258 run_tests_rig(DEBUG_CFLAGS +~ @[ " -fsanitize=address" ], cc,
1259 @[ "-Dmemcheck=1", "-Ddebug=1", "-Doptimization=3" ]);
1260 run_tests_rig(DEBUG_CFLAGS +~ @[ " -fsanitize=memory" ], cc,
1261 @[ "-Dmemcheck=1", "-Ddebug=1", "-Doptimization=3" ]);
1265 run_tests_rig(DEBUG_CFLAGS, cc, @[ "-gO3" ]);
1270 run_lib_tests_rig(DEBUG_CFLAGS +~ @[ " -fsanitize=address" ], cc,
1271 @[ "-Dmemcheck=1", "-Ddebug=1", "-Doptimization=3" ]);
1272 run_lib_tests_rig(DEBUG_CFLAGS +~ @[ " -fsanitize=memory" ], cc,
1273 @[ "-Dmemcheck=1", "-Ddebug=1", "-Doptimization=3" ]);
1278 @[ "-Ddebug=1", "-Doptimization=3" ]);
1288 ) -> void
1295 run_tests_rig(RELEASE_CFLAGS, cc, @[ "-Doptimization=s" ]);
1296 run_lib_tests_rig(RELEASE_CFLAGS, cc, @[ "-Doptimization=s" ]);
1306 ) -> void
1323 if valgrind
1332 fn build_sets_make() -> void
1334 header("Running math library under --standard with Rig");
1336 build_make(DEBUG_CFLAGS_STR +~ " -std=c99", defcc, "-g", true,
1339 $ bin/bc -ls << @("quit\n");
1357 fn build_sets_rig() -> void
1359 header("Running math library under --standard with Rig");
1361 build_rig(DEBUG_CFLAGS +~ @[ "-std=c99" ], defcc, @[ "-Ddebug=1" ],
1364 $ build/bc -ls << @("quit\n");
1379 fn build_sets() -> void
1392 (builder: str) -> void