forked from ziglang/zig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
command script import ~/prg/zig/0/tools/lldb_pretty_printers.py | ||
type category enable zig.stage2 zig.std zig | ||
type summary add --inline-children arch.x86_64.CodeGen.FrameAddr | ||
type summary add --inline-children arch.x86_64.CodeGen.RegisterOffset | ||
type summary add --inline-children arch.x86_64.CodeGen.InstTracking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
set -e | ||
build=build | ||
if [ "x$1" != x--debug ]; then | ||
cmake -GNinja -S. -B$build -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER:FILEPATH=clang -DCMAKE_CXX_COMPILER:FILEPATH=clang++ -DZIG_NO_LIB:BOOL=ON | ||
cmake --build $build | ||
cmake --install $build | ||
else | ||
shift | ||
fi | ||
$build/stage3/bin/zig build -p debug -Dno-lib -Denable-llvm "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
if [[ $1 == --behavior-c ]]; then | ||
shift | ||
./build.sh --debug && debug/bin/zig test -Itest test/behavior.zig -ofmt=c "$@" | ||
elif [[ $1 == --enable-fixed-behavior ]]; then | ||
backend=$2 | ||
shift 2 | ||
declare -A offsets | ||
git grep --no-index --line-number stage2_$backend test/behavior | while read -r match; do | ||
printf '\e[36mTrying to enable... %s\e[m\n' "$match" | ||
file=`cut -d: -f1 <<<"$match"` | ||
offset=${offsets[$file]:=0} | ||
echo "match = \"$match\"" | ||
let line=`cut -d: -f2 <<<"$match"`-$offset | ||
contents=`cut -d: -f3- <<<"$match"` | ||
sed --in-place "${line}d" "$file" | ||
if timeout 15s debug/bin/zig test -Itest test/behavior.zig "$@"; then | ||
printf '\e[32mTest was enabled! :)\e[m\n' | ||
let offsets[$file]+=1 | ||
else | ||
printf '\e[31mTest kept disabled. :(\e[m\n' | ||
sed --in-place "${line}i\\ | ||
$contents" "$file" | ||
fi | ||
done | ||
fi |