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
#include <cassert> | |
#include <cstdint> | |
enum Register_count { | |
gpr_registers_count = 0, | |
fpr_registers_count, | |
msa_registers_count, | |
register_set_count | |
}; |
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
#!/bin/bash | |
# git bisect start | |
# git bisect good <rev> | |
# git bisect bad <rev> | |
# git bisect run [script] | |
cd /home/davide/work/llvm-monorepo/build | |
ninja opt lli || exit 125 #125 tells git-bisect to skip | |
ulimit -t 5 && /home/davide/work/llvm-monorepo/build/bin/opt /home/davide/work/llvm-monorepo/build/bin/foo.ll -O3 | /home/davide/work/llvm-monorepo/build/bin/lli | |
[[ $? == 0 ]] && exit 0 |
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
Check 3 = 3. | |
Check forall n m : nat, n + m = m + n. | |
Definition is_three (n : nat) : Prop := | |
n = 3. | |
Definition injective {A B} (f : A -> B) := | |
forall x y : A, f x = f y -> x = y. | |
Lemma succ_inj : injective S. |
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
Inductive ev : nat -> Prop := | |
| ev_0 : ev 0 | |
| ev_SS : forall n : nat, ev n -> ev (S (S n)). | |
Theorem ev_4 : ev 4. | |
Proof. | |
apply ev_SS. | |
apply ev_SS. | |
apply ev_0. |
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
--- pat.diff 2018-03-12 14:53:39.000000000 -0700 | |
+++ pat2.diff 2018-03-12 14:54:14.000000000 -0700 | |
@@ -15,25 +15,25 @@ | |
decl: var intField: Int for 'intField' usr=s:14swift_ide_test8Myclass1C8intFieldSivp | |
decl: init() for '' usr=s:14swift_ide_test8Myclass1CACycfc | |
decl: func f1() for 'f1' usr=s:14swift_ide_test2f1yyF | |
-decl: func f1() for 's1ins' usr=s:14swift_ide_test2f1yyF5s1insL_AA9Mystruct1Vvp | |
+decl: var s1ins: Mystruct1 for 's1ins' usr=s:14swift_ide_test2f1yyF5s1insL_AA9Mystruct1Vvp | |
type: Mystruct1 for 's1ins' mangled=$S14swift_ide_test9Mystruct1VD | |
type: Int for 'intField' mangled=$SSiD |
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
# Python reference http://lldb.llvm.org/python-reference.html | |
import lldb | |
def main(): | |
dbg = lldb.SBDebugger.Create() | |
target = dbg.CreateTarget("a.out") | |
if not target: | |
print("Can't create target!") | |
return 1 |
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
Delta: | |
$ cat check-2.sh | |
#!/bin/bash | |
ulimit -t 3; ~/work/llvm/build-release/bin/opt -S $1 | ~/work/llvm/build-release/bin/lli | |
if ! test "$?" = "0"; then | |
exit 1 | |
fi |
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
davide@Davidinos-Mac-Pro ~/w/l/b/bin> ./clang ./pat.c -o pat -O1 -g | |
davide@Davidinos-Mac-Pro ~/w/l/b/bin> cat pat.c | |
int f(int x) { | |
asm(""); | |
return 0; | |
} | |
__attribute__((noinline)) | |
int g(int x) { | |
return x; |
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
func f1() -> Int32 { | |
let x : Int32 = Int32.max | |
let y : Int32 = 42 | |
return x + y | |
} | |
func f2(_ b : Bool) -> Int32 { | |
let verylarge : Int32 = Int32.max |
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
__attribute__((noinline)) | |
int fn1 (long int x, long int y, long int z) { | |
int l = x * 2; | |
int q = y * z; | |
return l + q; | |
} | |
__attribute__((noinline)) long int | |
fn2 (long int a, long int b, long int c) | |
{ |