├── .gitignore ├── .hgignore ├── README.md └── src ├── Makefile.in ├── aclocal.m4 ├── aclocal ├── ac_define_dir.m4 ├── ax_boost_base.m4 ├── ax_boost_filesystem.m4 ├── ax_boost_system.m4 ├── ax_compare_version.m4 ├── check_lib64.m4 ├── check_libgc.m4 ├── check_libicuuc.m4 ├── check_osdoc.m4 └── prog_bison_version.m4 ├── build ├── Makefile ├── bin │ ├── bitc-install │ ├── dirsync │ ├── flatten-html │ └── move-if-change └── make │ ├── build-rules.mk │ ├── common-rules.mk │ ├── doxygen-rules.mk │ ├── env-standard.mk │ ├── makerules.mk │ ├── makevars.mk │ ├── osdoc-rules.mk │ ├── pkgrules.mk │ ├── ps2pdf.sh │ ├── runlatex.sh │ └── xcache.sh ├── compiler ├── AST.ast ├── AST.cxx ├── AST.hxx ├── ASTaux.cxx ├── ASTimpl.cxx ├── BeginSimp.cxx ├── BitC-pp.cxx ├── BoostCompat.cxx ├── BoostCompat.hxx ├── Clconv.cxx ├── Constraints.cxx ├── DefreprCheck.cxx ├── DefreprXform.cxx ├── Environment.cxx ├── Environment.hxx ├── FQName.cxx ├── FQName.hxx ├── InitializerRules.doxy ├── InstLamHoist.cxx ├── Instantiate.cxx ├── Instantiate.hxx ├── LayoutProcessing.doxy ├── LitValue.cxx ├── LitValue.hxx ├── LocChk.cxx ├── MainPage.doxy ├── Makefile.in ├── MethDecl.cxx ├── Methods.doxy ├── MixFix.cxx ├── MixFix.doxy ├── MixFix.hxx ├── NoAllocCheck.cxx ├── Options.cxx ├── Options.hxx ├── Overview.doxy ├── ParseType.hxx ├── SSA.cxx ├── Simplify.cxx ├── Solver.cxx ├── Special.cxx ├── Special.hxx ├── Symtab.cxx ├── Symtab.hxx ├── TODO.txt ├── Tail.cxx ├── ToDo.doxy ├── TopInit.cxx ├── Trail.cxx ├── Trail.hxx ├── TransitionLexer.cxx ├── TransitionLexer.hxx ├── TransitionParser.y ├── TvPrinter.cxx ├── TvPrinter.hxx ├── Type-mangle.cxx ├── Type-pp.cxx ├── Type-size.cxx ├── Type-to-ast.cxx ├── Type-xml.cxx ├── Type.cxx ├── Type.hxx ├── TypeInfer.cxx ├── TypeInfer.hxx ├── TypeInferUtil.cxx ├── TypeInferUtil.hxx ├── TypeMut.cxx ├── TypeMut.hxx ├── TypePoly.cxx ├── TypeScheme.cxx ├── TypeScheme.hxx ├── TypeValRes.cxx ├── Typeclass.cxx ├── Typeclass.hxx ├── Unify.cxx ├── Unify.hxx ├── UocInfo.cxx ├── UocInfo.hxx ├── Version.hxx ├── WorkList.hxx ├── XML-pp.cxx ├── backend.cxx ├── backend.hxx ├── bitcc.cxx ├── bito.cxx ├── config.h.in ├── debug.hxx ├── doxygen.html.cfg ├── gen-c.cxx ├── inter-pass.cxx ├── inter-pass.hxx ├── libsherpa │ ├── BigNum.cxx │ ├── BigNum.hxx │ ├── EnumSet.hxx │ ├── INOstream.hxx │ ├── LToken.hxx │ ├── LexLoc.cxx │ ├── LexLoc.hxx │ ├── UExcept.cxx │ ├── UExcept.hxx │ ├── format.cxx │ ├── format.hxx │ ├── utf8.cxx │ ├── utf8.hxx │ ├── util.cxx │ └── util.hxx ├── machine-dep.hxx ├── onepass.def ├── pass.def ├── shared_ptr.cxx ├── shared_ptr.hxx ├── showrules.pl ├── stale │ ├── AlphaRename.cxx │ ├── BitcLexer.hxx │ ├── BitcLexer.l │ ├── Clconv.cxx │ ├── EqUnify.cxx │ ├── Fixinit.cxx │ ├── Gather.cxx │ ├── Hoist.cxx │ ├── Loop.cxx │ ├── NoClconv.hxx │ ├── Polyinst.cxx │ ├── ReprSimp.cxx │ ├── TypeChoice.cxx │ ├── TypeEqInfer.cxx │ ├── TypeEqInfer.hxx │ ├── TypeInferCommon.cxx │ ├── TypeInferCommon.hxx │ ├── c-gen.cxx │ ├── history.cxx │ └── refize.cxx ├── types.def └── ucs.hxx ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.in ├── doc ├── Makefile ├── bitc.xhtml ├── browse │ ├── Makefile │ └── index.xhtml ├── docs.ohtml ├── docs │ ├── Makefile │ ├── bitc │ │ ├── Internals.xml │ │ ├── Makefile │ │ ├── bitc-origins.xml │ │ ├── changes.xml │ │ ├── closures.xml │ │ ├── layout.xml │ │ ├── polyinst.xml │ │ ├── relnotes-0.10.xml │ │ ├── relnotes-0.9.xml │ │ ├── spec-0.10.xml │ │ ├── spec.xml │ │ └── unicode.xml │ ├── index.xml │ ├── latex_classes │ │ ├── acm_proc_article-sp.cls │ │ ├── llncs.cls │ │ └── sigplanconf.cls │ ├── old │ │ ├── e-formal.txml │ │ ├── eq-helper.xmli │ │ ├── eq-infer.xmli │ │ ├── eq-unify.xmli │ │ ├── hm_infer_proof.xmli │ │ ├── include │ │ │ ├── e-formal │ │ │ │ ├── cdecl.xmli │ │ │ │ ├── decl.xmli │ │ │ │ ├── eq-helper.xmli │ │ │ │ ├── eq-infer.xmli │ │ │ │ ├── eq-unify.xmli │ │ │ │ ├── equational.xmli │ │ │ │ ├── lang.xmli │ │ │ │ ├── locsem.xmli │ │ │ │ ├── opsem.xmli │ │ │ │ ├── semantics.xmli │ │ │ │ ├── subtype.xmli │ │ │ │ └── type_system.xmli │ │ │ └── sys-infer │ │ │ │ ├── decl.xmli │ │ │ │ ├── infer.xmli │ │ │ │ ├── opsem.xmli │ │ │ │ ├── solve.xmli │ │ │ │ └── unify.xmli │ │ ├── old_sys-infer.decl.xmli │ │ ├── old_sys-infer.infer.xmli │ │ ├── old_sys-infer.opsem.xmli │ │ ├── old_sys-infer.txml │ │ ├── old_sys-infer.unfsol.xmli │ │ └── sys-infer.txml │ ├── osverify-2004 │ │ ├── Makefile │ │ ├── llncs.cls │ │ └── osverify-2004.xml │ ├── papers │ │ ├── APLAS2008.txml │ │ ├── Makefile │ │ ├── PLOS2006-shap.xml │ │ ├── PLOS2006.xml │ │ ├── complete.txml │ │ ├── heuristic.txml │ │ ├── include │ │ │ ├── APLAS2008 │ │ │ │ ├── abstract.xmli │ │ │ │ ├── bibliography.xmli │ │ │ │ ├── conclusion.xmli │ │ │ │ ├── formal.xmli │ │ │ │ ├── grammar.xmli │ │ │ │ ├── infer.xmli │ │ │ │ ├── introduction.xmli │ │ │ │ ├── lang-comp.xmli │ │ │ │ ├── lang.xmli │ │ │ │ ├── operators.xmli │ │ │ │ ├── opsem.xmli │ │ │ │ ├── overview.xmli │ │ │ │ ├── related_work.xmli │ │ │ │ ├── type.xmli │ │ │ │ └── unify.xmli │ │ │ ├── complete │ │ │ │ ├── bibliography.xmli │ │ │ │ ├── declarative.xmli │ │ │ │ ├── equational.xmli │ │ │ │ ├── formal.xmli │ │ │ │ ├── grammar.xmli │ │ │ │ ├── lang.xmli │ │ │ │ ├── static_sem.xmli │ │ │ │ └── subst.xmli │ │ │ ├── heuristic │ │ │ │ ├── decl.xmli │ │ │ │ ├── heuristic.xmli │ │ │ │ ├── infer.xmli │ │ │ │ ├── intermediate.xmli │ │ │ │ ├── locsem.xmli │ │ │ │ ├── opsem.xmli │ │ │ │ ├── semantics.xmli │ │ │ │ ├── solve.xmli │ │ │ │ ├── subtype.xmli │ │ │ │ ├── type_system.xmli │ │ │ │ └── unify.xmli │ │ │ ├── mutinfer2007 │ │ │ │ ├── decl.xmli │ │ │ │ ├── eq-infer.xmli │ │ │ │ ├── eq-solve.xmli │ │ │ │ ├── eq-unify.xmli │ │ │ │ ├── gen.xmli │ │ │ │ ├── hm-infer.xmli │ │ │ │ ├── hm-solve.xmli │ │ │ │ ├── hm-unify.aux.xmli │ │ │ │ ├── hm-unify.xmli │ │ │ │ ├── locsem.xmli │ │ │ │ ├── opsem.xmli │ │ │ │ └── subtype.xmli │ │ │ └── new-formal │ │ │ │ ├── infer.xmli │ │ │ │ ├── operators.xmli │ │ │ │ ├── opsem.xmli │ │ │ │ ├── subtype.xmli │ │ │ │ ├── type.xmli │ │ │ │ └── unify.xmli │ │ ├── mutinfer2006.txml │ │ ├── mutinfer2007.txml │ │ └── new-formal.txml │ ├── txml_proc │ │ ├── bitc-types.dtd │ │ ├── btypes-osdoc.xsl │ │ └── fixup.pl │ └── unpublished │ │ ├── Makefile │ │ └── challenges.xml ├── download │ ├── Makefile │ └── index.xhtml ├── history.xhtml ├── img │ ├── doors │ │ ├── bg.gif │ │ ├── left_both.gif │ │ └── right_both.gif │ └── shap.jpg ├── navstyles.css ├── people.ohtml ├── projects │ ├── JointAssign.xhtml │ ├── Makefile │ └── index.xhtml ├── sidenav.html ├── sitefooter.html ├── siteheader.html ├── styles.css ├── svg-logo-inkscape.svg ├── svg-logo.svg ├── topnav.html └── topnav │ ├── HOWTO │ ├── Makefile │ ├── browse.bg.png │ ├── browse.fg.png │ ├── docs.bg.png │ ├── docs.fg.png │ ├── docs.html │ ├── download.html │ ├── doxygen.html │ ├── get_it.bg.png │ ├── get_it.fg.png │ ├── home.bg.png │ ├── home.fg.png │ ├── home.html │ ├── makepng.sh │ ├── projects.bg.png │ ├── projects.fg.png │ └── projects.html ├── install-sh ├── libbitc ├── MainPage.doxy ├── Makefile.in ├── arch │ ├── i386 │ │ └── make_procedure_object.c │ ├── powerpc │ │ └── make_procedure_object.c │ ├── sparc │ │ └── make_procedure_object.c │ ├── sparc64 │ │ └── make_procedure_object.c │ └── x86_64 │ │ └── make_procedure_object.c ├── bitc-runtime.bitc ├── bitc-runtime.bitc.sexpr ├── bitc │ ├── int.bitc │ ├── int.bitc.sexpr │ ├── list.bitc │ ├── list.bitc.sexpr │ ├── main.bitc │ ├── main.bitc.sexpr │ ├── math.bitc │ ├── math.bitc.sexpr │ ├── prelude.bitc │ ├── prelude.bitc.sexpr │ ├── runtime.h │ ├── sets │ │ └── bit.bitc │ ├── stdio.bitc │ ├── stdio.bitc.sexpr │ ├── stdlib.bitc │ ├── stdlib.bitc.sexpr │ ├── string.bitc │ ├── string.bitc.sexpr │ ├── target │ │ ├── arch-i386.bitc │ │ ├── arch-i386.bitc.sexpr │ │ ├── arch-sparc.bitc │ │ ├── arch-sparc.bitc.sexpr │ │ ├── arch-sparc64.bitc │ │ ├── arch-sparc64.bitc.sexpr │ │ ├── arch-x86_64.bitc │ │ └── arch-x86_64.bitc.sexpr │ ├── vector.bitc │ └── vector.bitc.sexpr ├── crypt │ ├── sha1.bitc │ ├── sha1.bitc.sexpr │ ├── sha1.bits │ └── sha1.bits.sexpr ├── doxygen.html.cfg ├── helper │ ├── README │ ├── gen.cxx │ └── genops.sh ├── nogc-allocator.c ├── stdio.c ├── stdlib.c └── string.c ├── man ├── Makefile.in └── bitcc.1.man ├── mkinstalldirs ├── plugins ├── emacs │ ├── Makefile │ └── bitc-mode │ │ ├── bitc-defs.el │ │ ├── bitc-font-lock.el │ │ ├── bitc-imenu.el │ │ ├── bitc-mode.el │ │ └── bitc-parse.el └── vim │ ├── filetype.vim │ ├── ftplugin │ ├── bitc.vim │ └── bits.vim │ └── syntax │ └── bitc.vim └── tests ├── Coyotos └── obstore │ ├── Makefile │ ├── cap.bitc │ └── capability.bitc ├── IA32 ├── GDT.bitc ├── GDT.bitc.old ├── Makefile └── jmp.bitc ├── Makefile.in ├── bugs ├── Let_test2.bitc ├── Makefile.in ├── expect.mk ├── r-and-t-1.bitc └── r-and-t-2.bitc ├── compileit.sh ├── convenience └── lambda-args.bitc ├── defloop ├── Makefile ├── ifa.bitc ├── ifb.bitc ├── srca.bitc └── srcb.bitc ├── error ├── disjoint.bitc ├── noinst.bitc ├── poly1.bitc └── unify-byref.bitc ├── experimental └── inner_ref.bitc ├── general ├── Makefile ├── acyclic.bitc ├── ambiguous.bitc ├── arith.bitc ├── atrans.bitc ├── badloop.bitc ├── basic.bitc ├── cgen.bitc ├── clconv.bitc ├── declbug.bitc ├── dummyvar.bitc ├── eq.bitc ├── examples.bitc ├── fact.bitc ├── fixinit.bitc ├── fnxn.bitc ├── gen.bitc ├── genbug.bitc ├── hoist.bitc ├── id.bitc ├── iface.bitc ├── iface02.bitc ├── iface1.bitc ├── iface2.bitc ├── iftest.bitc ├── import.bitc ├── incomplete.bitc ├── io.bitc ├── link.bitc ├── listif.bitc ├── loop.bitc ├── mod1.bitc ├── mod2.bitc ├── mut.bitc ├── mypair.bitc ├── nestedlambda.bitc ├── oddeven.bitc ├── pairtest.bitc ├── patbind.bitc ├── rectyp.bitc ├── refize.bitc ├── seetypes.sh ├── sp-bug.bitc ├── sp.bitc ├── structures.bitc ├── test1.bitc ├── test2.bitc ├── test3.bitc ├── testing.bitc ├── toc.bitc ├── unions.bitc ├── unit-fn.bitc ├── unittest.bitc ├── val-res.bitc ├── varbug.bitc └── vector.bitc ├── grammars ├── mixfix.output └── mixfix.y ├── issues ├── Makefile ├── badswitch.bitc ├── marison.bitc ├── mut-polyinst.bitc ├── type-poly.bitc └── unrefbug.bitc ├── n-unit ├── BitField.bitc ├── Makefile.in ├── aNil.bitc ├── adecl.bitc ├── alias.bitc ├── arith.bitc ├── arr-list.bitc ├── array-ref.bitc ├── basic.bitc ├── bitsizeof.bitc ├── bitwise.bitc ├── block.bitc ├── boolbit.bitc ├── boolnot.bitc ├── builtin.bitc ├── byref.bitc └── myID.bitc ├── parse ├── Makefile.in ├── expect.mk └── missing-then.bits ├── pretty ├── Makefile.in ├── alltypes.bits ├── alltypes.compile ├── alltypes.link ├── driver.bitc ├── excpt.bits ├── expect.mk ├── fn.bits ├── imenu.bits ├── importlist.bits ├── instance.bits ├── main.bits ├── mixedtypes.bits ├── repr.bits ├── struct.bits ├── trait.bits └── union.bits ├── reachbug ├── Makefile ├── ifa.bitc ├── ifb.bitc ├── srca.bitc └── srcb.bitc ├── stale ├── Loc1.bitc ├── Odd_Even.bitc ├── arith.bitc ├── defpair.bitc ├── indexible-length-field.bitc ├── mut1.bitc └── pairs.bitc ├── testit.sh └── unit ├── AppLoc.bitc ├── ArithInst.bitc ├── Array.bitc ├── BitField.bitc ├── CMangle.bitc ├── Cap-plus.bitc ├── Catch_Index_Error.bitc ├── Catch_in_a_Catch.bitc ├── DefRepr.bitc ├── DefRepr2.bitc ├── DefRepr3.bitc ├── DefReprCase.bitc ├── Dup.bitc ├── Echo_Args.bitc ├── Echo_Args.stdout ├── Exception.bitc ├── Fact-Loop.bitc ├── Fact-Mut.bitc ├── Fact-Rec.bitc ├── Flat-Union.bitc ├── ID.bitc ├── InvolvedException.bitc ├── Let_test.bitc ├── Loc2.bitc ├── Makefile.in ├── Odd_Even_proclaim.bitc ├── Ops.bitc ├── Polyinst-alpha.bitc ├── Polyinst.bitc ├── SmallUnion.bitc ├── Struct-Arr.bitc ├── Struct-Vec.bitc ├── TagType.bitc.fixme ├── Tail.bitc ├── ThrowLeg.bitc ├── UncaughtException.bitc ├── UncaughtException.stdout ├── VecBoundsError.bitc ├── VecBoundsError.stdout ├── Vector.bitc ├── aNil.bitc ├── adecl.bitc ├── alias.bitc ├── arr-list.bitc ├── array-ref.bitc ├── badsyntax.bitc ├── badsyntax.errout ├── basic.bitc ├── bindmethod.bitc ├── bitset.bitc ├── bitset.stdout ├── bitsizeof.bitc ├── bitwise.bitc ├── block.bitc ├── boolbit.bitc ├── boolnot.bitc ├── builtin.bitc ├── byref.bitc ├── captured-mut.bitc ├── catchall.bitc ├── chars.bitc ├── classunf.bitc ├── clconv.bitc ├── clconv1.bitc ├── clconv2.bitc ├── closure.bitc ├── closurebug.bitc ├── const1.bitc ├── const2.bitc ├── const3.bitc ├── copy-compat.bitc ├── copy-compat1.bitc ├── copy-compat2.bitc ├── ctr-test.bitc ├── cyclic.bitc ├── cyclic.errout ├── disjoint.bitc ├── dotest.bitc ├── echo-char.bitc ├── echo-char.stdin ├── echo-char.stdout ├── eq.bitc ├── eqPair.bitc ├── existential.bitc ├── expect.mk ├── extend.bitc ├── field-coerce.bitc ├── field-infer.bitc ├── field-method-infer.bitc ├── file.input ├── fill.bitc ├── forall.bitc ├── forall2.bitc ├── from-all.bitc ├── from.bitc ├── hello.bitc ├── hello.stdout ├── import_path.bitc ├── import_path.errout ├── inf.bitc ├── initArray.bitc ├── innerdef.bitc ├── inst-test1.bitc ├── inst-test2.bitc ├── inst-test3.bitc ├── intout.bitc ├── intout.stdout ├── io-time.bitc ├── io-time.stdout ├── layout-autoclose.bitc ├── layout-top-explicit.bitc ├── layout-top-implicit.bitc ├── let-polyinst.bitc ├── letrecdef.bitc ├── libbitc-bita.bitc ├── list-nullable.bitc ├── listvec.bitc ├── listvec2.bitc ├── lit.bitc ├── main-simple.bitc ├── make-mut-vec.bitc ├── mixfix.bitc ├── mkvecL-mut.bitc ├── mkvecL.bitc ├── mut-array.bitc ├── mut-cc-1.bitc ├── mut-cc-2.bitc ├── mut-cc-3.bitc ├── mut-struct.bitc ├── mut-vec.bitc ├── mut10.bitc ├── mut2.bitc ├── mut3.bitc ├── mut4.bitc ├── mut5.bitc ├── mut6.bitc ├── mut7.bitc ├── mut8.bitc ├── mut9.bitc ├── myID.bitc ├── newConstr1.bitc ├── newConstr2.bitc ├── newConstr3.bitc ├── newDef.bitc ├── newException.bitc ├── newException.stdout ├── newinf.bitc ├── newmain.bitc ├── not.bitc ├── nullable-cardelli.bitc ├── nullable.bitc ├── nunion-case.bitc.fixme ├── odd_even_letrec.bitc ├── phantom.bitc ├── proclaim.bitc ├── ref-types.bitc ├── ret-fun.bitc ├── seetypes.sh ├── sha1-file.bitc ├── sha1-file.stdout ├── sha1-test.bitc ├── sha1-test.stdout ├── sizeof.bitc ├── string-lex.bitc ├── string-lex.errout ├── structmethod.bitc ├── suspend.bitc ├── switch-multiple.bitc ├── switch-unify.bitc ├── switch.bitc ├── test_import └── bad_interface.bitc ├── toomanyargs.bitc ├── top-level-mut.bitc ├── tvar-scope.bitc ├── tvar-use1.bitc ├── twomodule.bitc ├── twomodule.stdout ├── unresolved.bitc ├── usesel-unbound.bitc ├── usesel-unbound.errout ├── utf8echo ├── vec-badly-typed.bitc ├── vec-badly-typed.errout ├── vec-infer.bitc ├── wchar.bitc └── wchar.stdout /.gitignore: -------------------------------------------------------------------------------- 1 | # begin section managed by etckeeper (do not edit this section by hand) 2 | 3 | # # ignore extension-less files (compiled filter) 4 | # ############################# 5 | * 6 | !*.* 7 | 8 | # new and old versions of conffiles, stored by dpkg 9 | *.dpkg-* 10 | 11 | # mount(8) records system state here, no need to store these 12 | blkid.tab 13 | blkid.tab.old 14 | 15 | # some other files in /etc that typically do not need to be tracked 16 | nologin 17 | ld.so.cache 18 | mtab 19 | .pwd.lock 20 | network/run 21 | adjtime 22 | lvm/cache 23 | 24 | # editor temp files 25 | *~ 26 | .*.sw? 27 | .sw? 28 | #*# 29 | DEADJOE 30 | 31 | # end section managed by etckeeper 32 | 33 | # ######################################## # 34 | # # http://help.github.com/ignore-files/ # # 35 | # ######################################## # 36 | 37 | # Compiled source # 38 | # ################### 39 | *.com 40 | *.class 41 | *.dll 42 | *.exe 43 | *.o 44 | *.so 45 | *.a 46 | *.dat 47 | *.dep 48 | *.hmap 49 | *.hi 50 | *.out 51 | 52 | # # Packages # 53 | # ############ 54 | # # it's better to unpack these files and commit the raw source 55 | # # git has its own built in compression methods 56 | *.7z 57 | *.dmg 58 | *.gz 59 | *.iso 60 | *.jar 61 | *.rar 62 | *.tar 63 | *.zip 64 | 65 | # # Logs and databases # 66 | # ###################### 67 | *.log 68 | *.sql 69 | *.sqlite 70 | 71 | # # OS generated files # 72 | # ###################### 73 | .DS_Store? 74 | ehthumbs.db 75 | Icon? 76 | Thumbs.db 77 | .DS_Store 78 | 79 | # # Haskell # 80 | # ########### 81 | cabal-dev 82 | dist 83 | .static-cache 84 | static/tmp 85 | .sqlite3 86 | 87 | # # Private # 88 | # ########### 89 | .ssh 90 | ssh 91 | id_rsa 92 | id_dsa 93 | identity 94 | .gitconfig 95 | .gitconfig* 96 | 97 | # # Misc # 98 | # ######## 99 | build 100 | *.pbxuser 101 | *.mode2v3 102 | *.mode1v3 103 | *.perspective 104 | *.perspectivev3 105 | .oh-my-zsh 106 | 107 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: regexp 2 | 3 | # Doxygen output: 4 | ^src/doc/browse/.* 5 | ^host/ 6 | 7 | syntax: glob 8 | 9 | src/config.h 10 | src/config.status 11 | src/compiler/config.h 12 | src/compiler/Makefile 13 | src/Makefile 14 | src/compiler/Makefile 15 | src/libbitc/Makefile 16 | src/man/Makefile 17 | src/tests/Makefile 18 | src/tests/unit/Makefile 19 | src/tests/parse/Makefile 20 | src/tests/pretty/Makefile 21 | src/tests/bugs/Makefile 22 | src/tests/n-unit/Makefile 23 | src/tests/grammars/*.cxx 24 | src/tests/grammars/*.hxx 25 | 26 | # Emacs turds: 27 | *~ 28 | \#* 29 | 30 | # Automake/autoconf turds: 31 | autom4te.cache 32 | 33 | callgrind.out.* 34 | cachegrind.out.* 35 | 36 | # Doxygen output directories: 37 | doxygen 38 | 39 | # vi[m] turds: 40 | *.swp 41 | 42 | *.aux 43 | *.bak 44 | *.idlxml 45 | *.img 46 | *.log 47 | *.ltx 48 | 49 | *.dvi 50 | *.eps 51 | *.exe 52 | *.gif 53 | *.pdf 54 | *.png 55 | *.ppm 56 | *.ps 57 | *.rpm 58 | *.spec 59 | *.toc 60 | *.xml.normalized 61 | *.svg 62 | 63 | # All output (in theory) goes into BUILD subdirectories. 64 | BUILD 65 | 66 | # In the BitC tree the majority of HTML files are generated. There 67 | # are a very few exceptions at the "top" of the doc tree. Those are 68 | # handled with explicit hg add. 69 | *.html 70 | 71 | # Doxygen output directories: 72 | doxygen 73 | 74 | # OSDoc chunked output directories: 75 | html-chunk 76 | 77 | src/doc/docs/dir.dev.gxml 78 | #dir.dev.xml 79 | 80 | # Some hand-built documents: 81 | src/doc/docs/papers/new-formal.xml 82 | src/doc/docs/papers/heuristic.xml 83 | src/doc/docs/papers/APLAS2008.xml 84 | src/doc/docs/papers/complete.xml 85 | src/doc/docs/papers/mutinfer2006.xml 86 | src/doc/docs/papers/mutinfer2007.xml 87 | 88 | # ELC files generated for emacs mode 89 | src/emacs/*.elc 90 | 91 | # Generated .c files in the test directory 92 | src/compiler/tests/unit/*.c 93 | src/compiler/tests/general/*.c 94 | 95 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [The BitC Programming Language](http://bitc-lang.org/) 2 | 3 | Download: http://bitc-lang.org/download/ 4 | 5 | Update from main Mercurial repo: 6 | 7 | git-hg pull http://dev.eros-os.com/hg/bitc 8 | 9 | Build: 10 | 11 | cd bitc/src 12 | # Set CXXFLAGS so that you can help us debug the compiler: 13 | CXXFLAGS=-g ./configure 14 | make 15 | 16 | If you are trying to track the development updates as we go, build with make clean: 17 | 18 | cd bitc/src 19 | # Set CXXFLAGS so that you can help us debug the compiler: 20 | CXXFLAGS=-g ./configure 21 | make clean 22 | make 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.10 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 | # 2005, 2006 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_include([aclocal/ac_define_dir.m4]) 15 | m4_include([aclocal/ax_boost_base.m4]) 16 | m4_include([aclocal/ax_boost_filesystem.m4]) 17 | m4_include([aclocal/ax_boost_system.m4]) 18 | m4_include([aclocal/ax_compare_version.m4]) 19 | m4_include([aclocal/check_lib64.m4]) 20 | m4_include([aclocal/check_libgc.m4]) 21 | m4_include([aclocal/check_libicuuc.m4]) 22 | m4_include([aclocal/check_osdoc.m4]) 23 | m4_include([aclocal/prog_bison_version.m4]) 24 | -------------------------------------------------------------------------------- /src/aclocal/ac_define_dir.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://autoconf-archive.cryp.to/ac_define_dir.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # This macro sets VARNAME to the expansion of the DIR variable, taking 12 | # care of fixing up ${prefix} and such. 13 | # 14 | # VARNAME is then offered as both an output variable and a C preprocessor 15 | # symbol. 16 | # 17 | # Example: 18 | # 19 | # AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) 20 | # 21 | # LAST MODIFICATION 22 | # 23 | # 2008-04-12 24 | # 25 | # COPYLEFT 26 | # 27 | # Copyright (c) 2008 Stepan Kasal 28 | # Copyright (c) 2008 Andreas Schwab 29 | # Copyright (c) 2008 Guido U. Draheim 30 | # Copyright (c) 2008 Alexandre Oliva 31 | # 32 | # Copying and distribution of this file, with or without modification, are 33 | # permitted in any medium without royalty provided the copyright notice 34 | # and this notice are preserved. 35 | 36 | AC_DEFUN([AC_DEFINE_DIR], [ 37 | prefix_NONE= 38 | exec_prefix_NONE= 39 | test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix 40 | test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix 41 | dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn 42 | dnl refers to ${prefix}. Thus we have to use `eval' twice. 43 | eval ac_define_dir="\"[$]$2\"" 44 | eval ac_define_dir="\"$ac_define_dir\"" 45 | AC_SUBST($1, "$ac_define_dir") 46 | AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) 47 | test "$prefix_NONE" && prefix=NONE 48 | test "$exec_prefix_NONE" && exec_prefix=NONE 49 | ]) 50 | -------------------------------------------------------------------------------- /src/aclocal/check_lib64.m4: -------------------------------------------------------------------------------- 1 | dnl On 64-bit targets there are many conventions for what to do about 2 | dnl libdir. On some systems, 64-bit libs go into /usr/lib64. Unfortunately, 3 | dnl there is no general rule or convention that can be used to decide this, 4 | dnl and when things are being cross-built, we cannot check. 5 | dnl 6 | dnl The attitude of the autoconf maintainers seems to be "only the user 7 | dnl knows, so have them tell us". Which would be fine, except that a lot 8 | dnl bunch of the autoconf macros fail in strange ways when checking for 9 | dnl library presence. If the 32-bit libraries are co-installed, that 10 | dnl masks the problem, but if they are not, then various things can go 11 | dnl wrong -- notably for us in the boost library checks. 12 | dnl 13 | dnl The following is a god-awful, ugly, horrible hack that reduces the 14 | dnl pain when we are NOT cross compiling by testing pointer size and 15 | dnl then checking for existence of /usr/lib64. 16 | dnl 17 | dnl If you are crazy enough to use this, put it just below your call 18 | dnl to AC_CANONICAL_TARGET, because that is what sets $cross_compiling, 19 | dnl and you don't want anything later to get the wrong answer for libdir. 20 | dnl A surprising number of autoconf macros check/use/fiddle that. 21 | 22 | AC_DEFUN([CHECK_LIB64], [ 23 | AC_CHECK_SIZEOF([void *]) 24 | if test "$cross_compiling" = "no"; then 25 | AC_MSG_CHECKING([For 64-bit native build]) 26 | if test "${ac_cv_sizeof_void_p}" = "8"; then 27 | AC_MSG_RESULT(yes) 28 | AC_MSG_CHECKING([ whether /usr/lib64 is present]) 29 | if test -d "/usr/lib64"; then 30 | AC_MSG_RESULT(yes) 31 | if test "$libdir" = '${exec_prefix}/lib'; then 32 | AC_MSG_NOTICE([*** Whacking libdir to \${exec_prefix}/lib64 ***]) 33 | libdir='${exec_prefix}/lib64'; 34 | fi 35 | else 36 | AC_MSG_RESULT(no) 37 | fi 38 | else 39 | AC_MSG_RESULT([no]) 40 | fi 41 | else 42 | if test "${ac_cv_sizeof_void_p}" = "8"; then 43 | AC_MSG_WARN([On some machines, it may be necessary to run configure with --libdir=/usr/lib64]) 44 | fi 45 | fi 46 | ])dnl 47 | -------------------------------------------------------------------------------- /src/aclocal/check_libgc.m4: -------------------------------------------------------------------------------- 1 | dnl Confirm that libgc is present, with headers. 2 | dnl 3 | dnl Note that this does NOT add libgc to LIBS automatically. We 4 | dnl don't want that for BitC build, and in any case the placement of 5 | dnl the -lgc in the link line is position-sensitive. 6 | 7 | AC_DEFUN([CHECK_LIBGC], [ 8 | AC_CHECK_HEADERS([gc/gc.h], [], [ 9 | AC_MSG_ERROR([Compiler output requires gc-devel or libgc-devel package]) ]) 10 | check_libgc_save_libs="$LIBS" 11 | AC_CHECK_LIB(gc, GC_init, [], [ 12 | AC_MSG_ERROR([Compiler output requires gc or libgc package]) ]) 13 | dnl Do NOT add -lgc to our link line! 14 | LIBS="$check_libgc_save_libs" 15 | ])dnl 16 | -------------------------------------------------------------------------------- /src/aclocal/check_libicuuc.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_LIBICUUC], [ 2 | AC_CHECK_HEADERS([unicode/uchar.h], [], [ 3 | AC_MSG_ERROR([Need to install libicu and possibly libicu-devel]) ]) 4 | AC_MSG_CHECKING([to see if libicuuc is installed.]) 5 | LIBS="-licuuc $LIBS" 6 | AC_LINK_IFELSE([ 7 | AC_LANG_PROGRAM([[#include ]], 8 | [[u_hasBinaryProperty(0,UCHAR_XID_START);]]) ], 9 | [ AC_MSG_RESULT([yes]) ], 10 | [ AC_MSG_RESULT([no]) 11 | AC_MSG_ERROR([Need to install libicu and possibly libicu-devel]) ]) 12 | ])dnl 13 | -------------------------------------------------------------------------------- /src/aclocal/check_osdoc.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_OSDOC], [ 2 | AC_CHECK_FILE(/usr/share/osdoc) 3 | if test "$ac_cv_file__usr_share_osdoc" = "yes"; then 4 | AC_DEFINE(HAVE_OSDOC, 1, 5 | [Define if you have the OSDoc documentation tools]) 6 | HAVE_OSDOC="yes" 7 | else 8 | HAVE_OSDOC="no" 9 | AC_MSG_WARN([Documentation cannot be built without OSDoc]) 10 | fi 11 | AC_SUBST(HAVE_OSDOC) 12 | ])dnl 13 | -------------------------------------------------------------------------------- /src/build/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2004, Jonathan S. Shapiro. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or 6 | # without modification, are permitted provided that the following 7 | # conditions are met: 8 | # 9 | # - Redistributions of source code must contain the above 10 | # copyright notice, this list of conditions, and the following 11 | # disclaimer. 12 | # 13 | # - Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions, and the following 15 | # disclaimer in the documentation and/or other materials 16 | # provided with the distribution. 17 | # 18 | # - Neither the names of the copyright holders nor the names of any 19 | # of any contributors may be used to endorse or promote products 20 | # derived from this software without specific prior written 21 | # permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | # 35 | 36 | default: package 37 | 38 | BITC_SRC=.. 39 | DIRS= 40 | 41 | include $(BITC_SRC)/build/make/pkgrules.mk 42 | -------------------------------------------------------------------------------- /src/build/bin/flatten-html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/build/bin/flatten-html -------------------------------------------------------------------------------- /src/build/bin/move-if-change: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2000, Jonathan S. Shapiro. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or 7 | # without modification, are permitted provided that the following 8 | # conditions are met: 9 | # 10 | # - Redistributions of source code must contain the above 11 | # copyright notice, this list of conditions, and the following 12 | # disclaimer. 13 | # 14 | # - Redistributions in binary form must reproduce the above 15 | # copyright notice, this list of conditions, and the following 16 | # disclaimer in the documentation and/or other materials 17 | # provided with the distribution. 18 | # 19 | # - Neither the names of the copyright holders nor the names of any 20 | # of any contributors may be used to endorse or promote products 21 | # derived from this software without specific prior written 22 | # permission. 23 | # 24 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | # 36 | 37 | src=$1 38 | target=$2 39 | 40 | if cmp -s $src $target 41 | then 42 | /bin/rm $src 43 | else 44 | mv $1 $2 45 | fi 46 | -------------------------------------------------------------------------------- /src/build/make/env-standard.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005, Jonathan S. Shapiro. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or 6 | # without modification, are permitted provided that the following 7 | # conditions are met: 8 | # 9 | # - Redistributions of source code must contain the above 10 | # copyright notice, this list of conditions, and the following 11 | # disclaimer. 12 | # 13 | # - Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions, and the following 15 | # disclaimer in the documentation and/or other materials 16 | # provided with the distribution. 17 | # 18 | # - Neither the names of the copyright holders nor the names of any 19 | # of any contributors may be used to endorse or promote products 20 | # derived from this software without specific prior written 21 | # permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | # 35 | 36 | GAWK=gawk 37 | -------------------------------------------------------------------------------- /src/build/make/pkgrules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005, Jonathan S. Shapiro. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or 6 | # without modification, are permitted provided that the following 7 | # conditions are met: 8 | # 9 | # - Redistributions of source code must contain the above 10 | # copyright notice, this list of conditions, and the following 11 | # disclaimer. 12 | # 13 | # - Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions, and the following 15 | # disclaimer in the documentation and/or other materials 16 | # provided with the distribution. 17 | # 18 | # - Neither the names of the copyright holders nor the names of any 19 | # of any contributors may be used to endorse or promote products 20 | # derived from this software without specific prior written 21 | # permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | # 35 | 36 | ifndef MAKERULES_LOADED 37 | include $(BITC_SRC)/build/make/makerules.mk 38 | endif 39 | 40 | #ifndef MAKEVARS_LOADED 41 | #include $(BITC_SRC)/build/make/makevars.mk 42 | #endif 43 | # 44 | #ifndef COMMONRULES_LOADED 45 | #include $(BITC_SRC)/build/make/common-rules.mk 46 | #endif 47 | 48 | # defaults for the interfaces, libs, and install targets: 49 | interfaces: 50 | libs: 51 | install: 52 | -------------------------------------------------------------------------------- /src/build/make/ps2pdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to run pdf2ps via an intermediate file 4 | ps2pdf $1 /tmp/$$.pdf 5 | mv /tmp/$$.pdf $2 6 | -------------------------------------------------------------------------------- /src/build/make/runlatex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to run latex multiple times until it converges, and then 4 | # produce an output file. 5 | 6 | latex $1 7 | latex $1 8 | latex $1 9 | -------------------------------------------------------------------------------- /src/compiler/Overview.doxy: -------------------------------------------------------------------------------- 1 | /* -*- mode: c -*- */ 2 | 3 | /** @page Overview Overview of the Front End 4 | * 5 | * The BitC front end is conceptually divided into three major phases: 6 | * surface syntax processing, validation, and code generation. 7 | * 8 | * @li The surface phase covers everything that is needed to 9 | * generate an AST. This is basically the parser and the lexer. The 10 | * main reason that this stage is distinguished is that we are 11 | * planning a re-work of the language surface syntax. 12 | * 13 | * @li The validation phase covers everything required to know 14 | * that you have a valid unit of compilation, or in interactive mode, 15 | * a valid top-level form. This includes a few AST simplification 16 | * passes, the symbol resolver, and various semantic checking 17 | * passes. It also includes a hoisting pass that converts lambda 18 | * instance forms into top level functions. This hoisting pass should 19 | * probably be moved into to the next phase. If compilation makes it 20 | * to the end of the UOC phase, the rest of the compilation should (in 21 | * theory) proceed without error unless compiler memory is exhausted. 22 | * 23 | * @li The code generation phase implements closure conversion, 24 | * tail recursion marking, and transformation of the code into an 25 | * SSA-like form. In essence, this covers all of the ``flattening'' 26 | * activities that are necessary to emit an IR representation of BitC 27 | * code for use by the back end. 28 | */ 29 | -------------------------------------------------------------------------------- /src/compiler/shared_ptr.cxx: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright (C) 2008, The EROS Group, LLC. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or 7 | * without modification, are permitted provided that the following 8 | * conditions are met: 9 | * 10 | * - Redistributions of source code must contain the above 11 | * copyright notice, this list of conditions, and the following 12 | * disclaimer. 13 | * 14 | * - Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions, and the following 16 | * disclaimer in the documentation and/or other materials 17 | * provided with the distribution. 18 | * 19 | * - Neither the names of the copyright holders nor the names of any 20 | * of any contributors may be used to endorse or promote products 21 | * derived from this software without specific prior written 22 | * permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | **************************************************************************/ 37 | 38 | #include "shared_ptr.hxx" 39 | 40 | namespace boost { 41 | GC_Null_tag GC_NULL; 42 | } 43 | -------------------------------------------------------------------------------- /src/compiler/showrules.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | open(F, "TypeInfer.cxx"); 4 | 5 | $mode = 0; 6 | 7 | while(!eof(F)) { 8 | $l = ; 9 | 10 | if($l =~ m/\/\*--------/) { 11 | $mode = 1; 12 | } 13 | elsif ($l =~ m/--------\*\//) { 14 | $mode = 0; 15 | print "\n\n"; 16 | } 17 | elsif($mode) { 18 | print $l; 19 | } 20 | } 21 | 22 | close(F); 23 | -------------------------------------------------------------------------------- /src/compiler/ucs.hxx: -------------------------------------------------------------------------------- 1 | #ifndef UCS_HXX 2 | #define UCS_HXX 3 | 4 | /************************************************************************** 5 | * 6 | * Copyright (C) 2010, Jonathan S. Shapiro 7 | * Portions Copyright (C) 2008, Johns Hopkins University 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or 11 | * without modification, are permitted provided that the following 12 | * conditions are met: 13 | * 14 | * - Redistributions of source code must contain the above 15 | * copyright notice, this list of conditions, and the following 16 | * disclaimer. 17 | * 18 | * - Redistributions in binary form must reproduce the above 19 | * copyright notice, this list of conditions, and the following 20 | * disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * - Neither the names of the copyright holders nor the names of any 24 | * of any contributors may be used to endorse or promote products 25 | * derived from this software without specific prior written 26 | * permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | **************************************************************************/ 41 | 42 | typedef long ucs4_t; 43 | 44 | #endif /* UCS_HXX */ 45 | -------------------------------------------------------------------------------- /src/doc/browse/index.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Doxygen-Annotated Sources 7 | 8 | 9 |

Doxygen-Annotated Sources

10 |

11 | Much of the code is annotated using doxygen. When the 12 | implementation is in rapid motion, the doxygen pages are 13 | sometimes updated ahead of the specification. 14 |

15 |

16 | Pieces you can look at through Doxygen: 17 |

18 |
    19 |
  • 20 |

    21 | The compiler 22 |

    23 |
  • 24 |
  • 25 |

    26 | The library (C portion) 27 |

    28 |
  • 29 |
  • 30 |

    31 | The runtime (soon) 32 |

    33 |
  • 34 |
  • 35 |

    36 | The BitC portion of the library (when someone implements the doxygen support) 37 |

    38 |
  • 39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /src/doc/docs.ohtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Coyotos Documents 7 | 8 | 9 |

Coyotos Documents

10 |

11 | Yes, we already have some Coyotos-related documentation. Since 12 | we're trying to get a scaffolding website up quickly, we haven't 13 | got those documents integrated into the site yet. When this 14 | changes, an item will appear in the News pane. 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /src/doc/docs/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | BitC Documentation 6 | 7 | 8 | The BitC Language and System 9 | 10 | 11 | 12 | Published Papers 13 |

Papers about Coyotos or BitC.

14 | 15 |
16 | 17 | Technical Reports 18 | 19 | 20 | 21 | The Compiler Implementation 22 | 23 | 24 |
25 | -------------------------------------------------------------------------------- /src/doc/docs/osverify-2004/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2004, Jonathan S. Shapiro. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or 6 | # without modification, are permitted provided that the following 7 | # conditions are met: 8 | # 9 | # - Redistributions of source code must contain the above 10 | # copyright notice, this list of conditions, and the following 11 | # disclaimer. 12 | # 13 | # - Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions, and the following 15 | # disclaimer in the documentation and/or other materials 16 | # provided with the distribution. 17 | # 18 | # - Neither the names of the copyright holders nor the names of any 19 | # of any contributors may be used to endorse or promote products 20 | # derived from this software without specific prior written 21 | # permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | # 35 | 36 | default: package 37 | BITC_SRC=../../.. 38 | 39 | OSDOC_XML_SRC=osverify-2004 40 | 41 | include $(BITC_SRC)/build/make/makerules.mk 42 | 43 | install: all 44 | -------------------------------------------------------------------------------- /src/doc/docs/papers/include/APLAS2008/abstract.xmli: -------------------------------------------------------------------------------- 1 | 2 | 5 | ]> 6 | 7 |

8 | This paper introduces a new type system designed for 9 | safe systems programming. The type system features 10 | a new mutability model that combines unboxed types 11 | with a consistent typing of mutability. The type system is 12 | provably sound, supports polymorphism, and eliminates the need 13 | for alias analysis to determine the immutability of a location. 14 | A sound and complete type inference algorithm for this system is 15 | presented. 16 |

17 |
18 | -------------------------------------------------------------------------------- /src/doc/docs/papers/include/APLAS2008/conclusion.xmli: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | Conclusions 9 |

10 | In this paper, we have defined a language and type system 11 | for systems programming which integrates all of unboxed 12 | representation, consistent complete mutability support, and 13 | polymorphism. The mutability model is expressive enough to 14 | permit mutation of unboxed/stack locations, and at the same time 15 | guarantees that types are definitive about the mutability of 16 | every location across all aliases. 17 |

18 |

19 | Complete support for mutability introduces challenges for type 20 | inference at copy boundaries. We have developed a novel algorithm 21 | that infers principal types using a system of constrained 22 | types. To our knowledge, this is the first sound and complete 23 | algorithm that infers both mutability and polymorphism in a 24 | systems programming language with copy compatibility. 25 |

26 |

27 | The type inference algorithm is implemented as part of the 28 | BitC  language compiler. 29 | The core of the compiler involves 22,433 lines of C++ code, of 30 | which implementation of the type system accounts for about 31 | 7,816 lines. 32 | The source code can be obtained from 33 | 34 | http://bitc-lang.org. 35 | 36 |

37 |
38 | -------------------------------------------------------------------------------- /src/doc/docs/papers/include/heuristic/locsem.xmli: -------------------------------------------------------------------------------- 1 | 2 | 5 |
6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Location Semantics 69 |
70 | -------------------------------------------------------------------------------- /src/doc/docs/papers/include/mutinfer2007/eq-unify.xmli: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Equational Unification Rules 68 | 69 | -------------------------------------------------------------------------------- /src/doc/docs/papers/include/mutinfer2007/gen.xmli: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ` 60 | 61 | Generalization Rules 62 | 63 | -------------------------------------------------------------------------------- /src/doc/docs/papers/include/mutinfer2007/locsem.xmli: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Location Semantics Rules 67 | 68 | -------------------------------------------------------------------------------- /src/doc/history.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | The Path to BitC 7 | 8 | 9 |

The Path to BitC

10 |

11 | At some point during the Coyotos project, we realized 13 | that we wanted a safer and more expressive programming 14 | language. Also, we wanted a language that we could analyze 15 | more readily using model checkers and formal verifiers. BitC 16 | is a first step toward realizing this objective. 17 |

18 |

19 | Jonathan S. Shapiro
20 | December, 2004 21 |

22 | 23 | 24 | -------------------------------------------------------------------------------- /src/doc/img/doors/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/img/doors/bg.gif -------------------------------------------------------------------------------- /src/doc/img/doors/left_both.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/img/doors/left_both.gif -------------------------------------------------------------------------------- /src/doc/img/doors/right_both.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/img/doors/right_both.gif -------------------------------------------------------------------------------- /src/doc/img/shap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/img/shap.jpg -------------------------------------------------------------------------------- /src/doc/navstyles.css: -------------------------------------------------------------------------------- 1 | /* Likewise the box widths for the various content areas! */ 2 | 3 | /* If you change the background color, be sure to change it 4 | throughout. */ 5 | body { background: #e8ffe8; } 6 | A.noborder:link { color: #e8ffe8; } 7 | A.noborder:visited { color: #e8ffe8; } 8 | A.noborder:hover { color: blue; } 9 | A.noborder:active { color: red; } 10 | 11 | div.nowrap { 12 | word-wrap: normal; 13 | } 14 | 15 | div.wrap { 16 | word-wrap: break-word; 17 | } 18 | 19 | A:link { text-decoration: none; color: blue } 20 | A:visited { text-decoration: none; color: blue } 21 | A:hover { color: red } 22 | -------------------------------------------------------------------------------- /src/doc/people.ohtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Coyotos People 7 | 8 | 9 |

Coyotos People

10 |

At Hopkins

11 |

12 | Swaroop Sridhar and M. Scott Doerrie are working 13 | on the BitC project at Johns Hopkins University. Swaroop has 14 | worked on high-performance dynamic translation technology, and 15 | currently is in charge of the BitC compiler and semantics for 16 | the Coyotos project. Scott is our verification expert. Among 17 | other things, Scott has the unusual distinction of having 18 | identified and corrected a bug in the EROS specification from an 19 | attempt to formalize the design constraints, and originated an 20 | alternative approach that does not yield anomolous behavior. 21 |

22 |

At The EROS Group

23 |

24 | Jonathan 27 | S. Shapiro is the managing partner of The EROS 28 | Group. He is the primary architect of EROS, the predecessor to 30 | Coyotos. Dr. Shapiro did most of the writing of the Coyotos 31 | specification, designed and implemented the cross-environment 32 | tools, and spends an inordinate amount of time handling 33 | administrivia for the company. He now works primarily on the 34 | application-level environment for Coyotos. 35 |

36 |
37 |

Other Contributors

38 |

39 | Mark Miller has now returned to Hewlett Packard 40 | Laboratories, but has consulted on many aspects of the BitC 41 | design. Check out some of Mark's current work on the E Programming Language. 43 |

44 | 45 | 46 | -------------------------------------------------------------------------------- /src/doc/projects/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2004, Jonathan S. Shapiro. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or 6 | # without modification, are permitted provided that the following 7 | # conditions are met: 8 | # 9 | # - Redistributions of source code must contain the above 10 | # copyright notice, this list of conditions, and the following 11 | # disclaimer. 12 | # 13 | # - Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions, and the following 15 | # disclaimer in the documentation and/or other materials 16 | # provided with the distribution. 17 | # 18 | # - Neither the names of the copyright holders nor the names of any 19 | # of any contributors may be used to endorse or promote products 20 | # derived from this software without specific prior written 21 | # permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | # 35 | 36 | default: package 37 | BITC_SRC=../.. 38 | OSDOC_NAVCONTEXT="Projects" 39 | OSDOC_XHTML_SRC=$(patsubst %.xhtml,%,$(wildcard *.xhtml)) 40 | OSDOC_OHTML_SRC=$(patsubst %.ohtml,%,$(wildcard *.ohtml)) 41 | HTML_TOPNAV=projects.html 42 | 43 | DOCSTYLES= #docstyles.css 44 | 45 | include $(BITC_SRC)/build/make/makerules.mk 46 | 47 | all: 48 | 49 | install: all 50 | -------------------------------------------------------------------------------- /src/doc/projects/index.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | BitC Projects 7 | 8 | 9 |

BitC Projects

10 |

11 | This page will shortly provide an index of projects that are 12 | underway or needed. 13 |

14 |

Things that would help

15 |

16 | Now that the surface syntax is stabilizing, it would really help 17 | us to have an input filter for doxygen so that we can feed a 18 | mixed body of BitC and C/C++ code to doxygen for comprehensive 19 | documentation. 20 |

21 | 22 | 23 | -------------------------------------------------------------------------------- /src/doc/sidenav.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Left Navigation Bar 4 | 5 | 13 | 14 | 15 |

News

16 |

17 | 10 November 2010: To-Do list for full release 18 | here, though you might prefer 19 | to locate that page from the index. 21 |

22 |

23 | 10 November 2010: S-expression syntax finally 24 | retired. Still need to update the specification. 25 |

26 |

27 | 7 October 2010: VIM and Emacs modes now in the tree. 28 |

29 |

30 | 25(?) September 2010: Mixfix implementation completed. 31 |

32 |

33 | 31 August 2010: 34 | Instructions for fetching via mercurial. 35 |

36 |

37 | 26 August 2010: Doc describing implementation of layout. 38 |

39 |

Info

40 |

41 | People
42 | History 43 |

44 | 45 | 46 | 54 | -------------------------------------------------------------------------------- /src/doc/sitefooter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Site Footer 4 | 5 | 6 | 7 | Web site Copyright © 2010, 8 | The EROS Group, LLC
9 | All rights reserved.
10 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /src/doc/siteheader.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Site Header 4 | 5 | 6 |

The BitC Programming Language.
7 | When reliability matters.

8 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /src/doc/svg-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 14 | 16 | S 25 | V 34 | G 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/doc/topnav.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | People NavBar 4 | 5 | 6 | 7 | 24 | 25 | 26 | 34 | -------------------------------------------------------------------------------- /src/doc/topnav/HOWTO: -------------------------------------------------------------------------------- 1 | In order to generate the PNG files, use: 2 | 3 | ../makepng.sh 'SomeString' 4 | 5 | If the string gets too big, you may need to tweak parameters in the 6 | makepng script. 7 | -------------------------------------------------------------------------------- /src/doc/topnav/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2004, Jonathan S. Shapiro. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or 6 | # without modification, are permitted provided that the following 7 | # conditions are met: 8 | # 9 | # - Redistributions of source code must contain the above 10 | # copyright notice, this list of conditions, and the following 11 | # disclaimer. 12 | # 13 | # - Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions, and the following 15 | # disclaimer in the documentation and/or other materials 16 | # provided with the distribution. 17 | # 18 | # - Neither the names of the copyright holders nor the names of any 19 | # of any contributors may be used to endorse or promote products 20 | # derived from this software without specific prior written 21 | # permission. 22 | # 23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | # 35 | 36 | default: package 37 | BITC_SRC=../.. 38 | 39 | include $(BITC_SRC)/build/make/makerules.mk 40 | -------------------------------------------------------------------------------- /src/doc/topnav/browse.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/browse.bg.png -------------------------------------------------------------------------------- /src/doc/topnav/browse.fg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/browse.fg.png -------------------------------------------------------------------------------- /src/doc/topnav/docs.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/docs.bg.png -------------------------------------------------------------------------------- /src/doc/topnav/docs.fg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/docs.fg.png -------------------------------------------------------------------------------- /src/doc/topnav/docs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs NavBar 4 | 5 | 6 | 7 | 34 | 35 | 36 | 44 | -------------------------------------------------------------------------------- /src/doc/topnav/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | People NavBar 4 | 5 | 6 | 7 | 34 | 35 | 36 | 44 | -------------------------------------------------------------------------------- /src/doc/topnav/doxygen.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs NavBar 4 | 5 | 6 | 7 | 34 | 35 | 36 | 44 | -------------------------------------------------------------------------------- /src/doc/topnav/get_it.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/get_it.bg.png -------------------------------------------------------------------------------- /src/doc/topnav/get_it.fg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/get_it.fg.png -------------------------------------------------------------------------------- /src/doc/topnav/home.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/home.bg.png -------------------------------------------------------------------------------- /src/doc/topnav/home.fg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/home.fg.png -------------------------------------------------------------------------------- /src/doc/topnav/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | People NavBar 4 | 5 | 6 | 7 | 34 | 35 | 36 | 44 | -------------------------------------------------------------------------------- /src/doc/topnav/makepng.sh: -------------------------------------------------------------------------------- 1 | FGBACKCOLOR=lightgrey 2 | FGTEXTCOLOR=black 3 | BGBACKCOLOR=darkgrey 4 | BGTEXTCOLOR=white 5 | 6 | PNGSIZE=84x20 7 | PTSIZE=14 8 | 9 | GENPNG="convert -gravity center -size ${PNGSIZE} -font Helvetica -pointsize ${PTSIZE} -antialias" 10 | 11 | for i in "$@" 12 | do 13 | filename=`echo $i | tr '[A-Z ]' '[a-z_]'` 14 | fgfile="${filename}.fg.png" 15 | bgfile="${filename}.bg.png" 16 | ${GENPNG} xc:${FGBACKCOLOR} -fill ${FGTEXTCOLOR} -draw "text 0,0 '${i}'" ${fgfile} 17 | #convert -bordercolor blue -border 2x2 ${fgfile} ${fgfile} 18 | ${GENPNG} xc:${BGBACKCOLOR} -fill ${BGTEXTCOLOR} -draw "text 0,0 '${i}'" ${bgfile} 19 | #convert -bordercolor white -border 2x2 ${bgfile} ${bgfile} 20 | done 21 | -------------------------------------------------------------------------------- /src/doc/topnav/projects.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/projects.bg.png -------------------------------------------------------------------------------- /src/doc/topnav/projects.fg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repos-bitc/bitc/e9f37d026ad2eeba221c73b2b6d7628c1b914205/src/doc/topnav/projects.fg.png -------------------------------------------------------------------------------- /src/doc/topnav/projects.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | People NavBar 4 | 5 | 6 | 7 | 34 | 35 | 36 | 44 | -------------------------------------------------------------------------------- /src/libbitc/MainPage.doxy: -------------------------------------------------------------------------------- 1 | /* -*- mode: c++ -*- */ 2 | 3 | /// @mainpage Source Code for the BitC Runtime Library 4 | /// 5 | /// On these pages you can browse the source code for the BitC runtime 6 | /// library and examine its source documentation, which is still a 7 | /// work in progress. All architectures are documented simultaneously, 8 | /// which means (for example) that there are multiple 9 | /// implementations of bitc_emit_procedure_object. This is intentional. 10 | -------------------------------------------------------------------------------- /src/libbitc/bitc/main.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // Copyright (C) 2010, Jonathan S. Shapiro 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or 8 | // without modification, are permitted provided that the following 9 | // conditions are met: 10 | // 11 | // - Redistributions of source code must contain the above 12 | // copyright notice, this list of conditions, and the following 13 | // disclaimer. 14 | // 15 | // - Redistributions in binary form must reproduce the above 16 | // copyright notice, this list of conditions, and the following 17 | // disclaimer in the documentation and/or other materials 18 | // provided with the distribution. 19 | // 20 | // - Neither the names of the copyright holders nor the names of any 21 | // of any contributors may be used to endorse or promote products 22 | // derived from this software without specific prior written 23 | // permission. 24 | // 25 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | // 37 | ////////////////////////////////////////////////////////////////////////// 38 | 39 | bitc version 0.11 40 | 41 | interface bitc.main { 42 | def main : fn(string[]) -> int32 external bitc_main 43 | } 44 | -------------------------------------------------------------------------------- /src/libbitc/bitc/main.bitc.sexpr: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc version 0.10) 39 | (interface bitc.main 40 | (proclaim main: (fn (vector string) -> int32) external bitc_main) 41 | ) 42 | -------------------------------------------------------------------------------- /src/libbitc/bitc/math.bitc.sexpr: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | ;; Computes a ^ n 39 | (define (pow a n) 40 | (do ((i n (- i 1)) 41 | (ans 1 (* ans a))) 42 | ((== i 0) ans) ())) 43 | -------------------------------------------------------------------------------- /src/libbitc/bitc/stdlib.bitc.sexpr: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc version 0.10) 39 | (interface bitc.stdlib 40 | (proclaim atoi: (fn string -> int32) external bitc_stdlib_atoi) 41 | (proclaim getTimeStamp: (fn -> uint64) external bitc_stdlib_getTimeStamp) 42 | ) 43 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-i386.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, The EROS Group, LLC. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | interface bitc.target.arch { 41 | // Architecture-specific information for i386 42 | 43 | def WordSize = 32 44 | } 45 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-i386.bitc.sexpr: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2010, The EROS Group, LLC. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc version 0.10) 39 | (interface bitc.target.arch 40 | ;; Architecture-specific information for i386 41 | 42 | (define WordSize 32) 43 | ) 44 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-sparc.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, The EROS Group, LLC. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | interface bitc.target.arch { 41 | // Architecture-specific information for SPARC 42 | 43 | def WordSize = 32 44 | } 45 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-sparc.bitc.sexpr: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2010, The EROS Group, LLC. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc version 0.10) 39 | (interface bitc.target.arch 40 | ;; Architecture-specific information for SPARC 41 | 42 | (define WordSize 32) 43 | ) 44 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-sparc64.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, The EROS Group, LLC. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | interface bitc.target.arch { 41 | // Architecture-specific information for SPARC64 42 | 43 | def WordSize = 64 44 | } 45 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-sparc64.bitc.sexpr: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2010, The EROS Group, LLC. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc version 0.10) 39 | (interface bitc.target.arch 40 | ;; Architecture-specific information for SPARC64 41 | 42 | (define WordSize 64) 43 | ) 44 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-x86_64.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, The EROS Group, LLC. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | interface bitc.target.arch { 41 | // Architecture-specific information for x86_64 42 | 43 | def WordSize = 64 44 | } 45 | -------------------------------------------------------------------------------- /src/libbitc/bitc/target/arch-x86_64.bitc.sexpr: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2010, The EROS Group, LLC. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc version 0.10) 39 | (interface bitc.target.arch 40 | ;; Architecture-specific information for x86_64 41 | 42 | (define WordSize 64) 43 | ) 44 | -------------------------------------------------------------------------------- /src/libbitc/helper/README: -------------------------------------------------------------------------------- 1 | This directory contains two "helper" programs that are not normally 2 | run as part of the library build. 3 | 4 | 5 | genops.sh: When code is emitted via the gen-c.cxx back end, the file 6 | bitc/runtime.h is included at the top of all BitC 7 | compiler output files. In that file, there is a 8 | depressingly long series of built-in operations that 9 | define sign extension, zero extension, and truncation 10 | operators on bitfields. These are, to put it mildly, 11 | a royal pain in the ass to update, because there are so 12 | many entries. 13 | 14 | The genops.sh emits them automatically. 15 | 16 | gen.cxx: This is a similar file whose purpose was to emit a bunch 17 | of instance definitions that made every bitfield type a 18 | member of the Integral type class. This turned out to be 19 | a bad idea, and the file is probably now stale. 20 | -------------------------------------------------------------------------------- /src/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1 2000/12/10 13:48:36 shap Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 1>&2 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /src/plugins/emacs/Makefile: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # 3 | # Copyright (C) 2006, Johns Hopkins University. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or 7 | # without modification, are permitted provided that the following 8 | # conditions are met: 9 | # 10 | # - Redistributions of source code must contain the above 11 | # copyright notice, this list of conditions, and the following 12 | # disclaimer. 13 | # 14 | # - Redistributions in binary form must reproduce the above 15 | # copyright notice, this list of conditions, and the following 16 | # disclaimer in the documentation and/or other materials 17 | # provided with the distribution. 18 | # 19 | # - Neither the names of the copyright holders nor the names of any 20 | # of any contributors may be used to endorse or promote products 21 | # derived from this software without specific prior written 22 | # permission. 23 | # 24 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | # 36 | ########################################################################## 37 | 38 | bitc.elc: bitc.el 39 | emacs --batch --eval '(progn (setq load-path (cons "." load-path)) (byte-compile-file "bitc.el"))' 40 | -------------------------------------------------------------------------------- /src/plugins/vim/filetype.vim: -------------------------------------------------------------------------------- 1 | augroup filetypedetect 2 | au BufNewFile,BufRead *.bitc set filetype=bitc 3 | au BufNewFile,BufRead *.bits set filetype=bitc 4 | augroup END 5 | -------------------------------------------------------------------------------- /src/plugins/vim/ftplugin/bitc.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin file 2 | " Language: BitC 3 | " Maintainer: Jonathan Shapiro 4 | " Last Changed: 24 Sep 2010 5 | 6 | if exists("b:did_ftplugin") 7 | finish 8 | endif 9 | 10 | let b:did_ftplugin = 1 11 | 12 | let b:undo_ftplugin = "setl fo<" 13 | 14 | " Set 'formatoptions' to break comment lines but not other lines, 15 | " and insert the comment leader when hitting or using "o". 16 | setlocal fo-=t fo+=croql 17 | 18 | setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// 19 | 20 | " When the matchit plugin is loaded, this makes the % command skip parens and 21 | " braces in comments. 22 | let b:match_words = &matchpairs 23 | let b:match_skip = 's:comment\|string\|character' 24 | 25 | setlocal commentstring=/*%s*/ 26 | setlocal expandtab 27 | -------------------------------------------------------------------------------- /src/plugins/vim/ftplugin/bits.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin file 2 | " Language: BitC 3 | " Maintainer: Jonathan Shapiro 4 | " Last Changed: 24 Sep 2010 5 | 6 | " Only do this when not done yet for this buffer 7 | if exists("b:did_ftplugin") 8 | finish 9 | endif 10 | 11 | " Behaves just like BitC: 12 | runtime! ftplugin/bitc.vim ftplugin/bitc_*.vim ftplugin/bitc/*.vim 13 | -------------------------------------------------------------------------------- /src/tests/Coyotos/obstore/cap.bitc: -------------------------------------------------------------------------------- 1 | (defrepr capability 2 | (tag prepared unprepared) : (bitfield uint32 1) 3 | 4 | hazard : (bitfield uint32 1) 5 | 6 | (tag Null Window KeyBits Discrim Range Sleep IRQCtl 7 | SchedCtl Checkpoint ObStore ioperm PinCtl 8 | 9 | FCRB RcvQ Wrapper Page CapPage GPT oGPT Process 10 | 11 | FcrbSend RcvqSend WrapperSend) : (bitfield uint32 6) 12 | 13 | wk : (bitfield uint32 1) 14 | nx : (bitfield uint32 1) 15 | ro : (bitfield uint32 1) 16 | ro : (bitfield uint32 1) 17 | 18 | (fill (bitfield uint32 1)) 19 | 20 | (case ((FcrbSend RcvqSend WrapperSend Process 21 | Page CaPage GPD oGPT FCRB) 22 | ((the (bitfield uint32 20) allocCount))) 23 | 24 | (otherwise ((fill (bitfield uint32 20))))) 25 | 26 | (case ((Page CaPage GPD oGPT FCRB Window) 27 | (l2uv : (bitfield uint32 6) 28 | l2v : (bitfield uint32 6) 29 | guard : (bitfield uint32 20)))) 30 | 31 | (case ((FcrbSend RcvqSend WrapperSend Process 32 | Page CaPage GPD oGPT FCRB) 33 | (case prepared ((the PrepHeader ph) 34 | (the ObHeader target))) 35 | (case unprepared ((the oid_t oid))))) 36 | ) 37 | -------------------------------------------------------------------------------- /src/tests/Coyotos/obstore/capability.bitc: -------------------------------------------------------------------------------- 1 | (defrepr capability 2 | (tag prepared unprepared) : (bitfield uint32 1) 3 | 4 | hazard : (bitfield uint32 1) 5 | 6 | (tag Null Window KeyBits Discrim Range Sleep IRQCtl 7 | SchedCtl Checkpoint ObStore ioperm PinCtl 8 | 9 | FCRB RcvQ Wrapper Page CapPage GPT oGPT Process 10 | 11 | FcrbSend RcvqSend WrapperSend) : (bitfield uint32 6) 12 | 13 | wk : (bitfield uint32 1) 14 | nx : (bitfield uint32 1) 15 | ro : (bitfield uint32 1) 16 | ro : (bitfield uint32 1) 17 | 18 | (fill (bitfield uint32 1)) 19 | 20 | (case ((FcrbSend RcvqSend WrapperSend Process 21 | Page CaPage GPD oGPT FCRB) 22 | ((the (bitfield uint32 20) allocCount))) 23 | 24 | (otherwise ((fill (bitfield uint32 20))))) 25 | 26 | (case ((Page CaPage GPD oGPT FCRB Window) 27 | (l2uv : (bitfield uint32 6) 28 | l2v : (bitfield uint32 6) 29 | guard : (bitfield uint32 20)))) 30 | 31 | (case ((FcrbSend RcvqSend WrapperSend Process 32 | Page CaPage GPD oGPT FCRB) 33 | (case prepared ((the PrepHeader ph) 34 | (the ObHeader target))) 35 | (case unprepared ((the oid_t oid))))) 36 | ) 37 | -------------------------------------------------------------------------------- /src/tests/IA32/jmp.bitc: -------------------------------------------------------------------------------- 1 | ; As an example, we show the encoding of the op-code for an 2 | ; unconditional jump instruction provided by the IA-32 3 | ; architecture. Since IA-32 is a CISC architecture, the 4 | ; jmp instruction has different versions with varying lengths. 5 | ; In the interest of brevity, we present the encodings 6 | ; only for the cases shown in fllowing table. 7 | ; 8 | ; Op code} Mod/rm Instruction Description 9 | ; (hex) (binary) 10 | ; EB CB JMP rel8 Jump relative, 8-bit displacement 11 | ; E9 CD JMP rel32 Jump relative, 32-bit displacement 12 | ; FF 11 100 reg JMP reg Jump absolute, register direct 13 | ; FF 00 100 101 JMP imm32 Jump absolute, immediate indirect 14 | 15 | 16 | (defrepr jmp:val 17 | (jmp-short-rel 18 | opCode: uint8 19 | opCode2: uint8 20 | disp8: uint8 21 | (where (== opCode 16rEB) (== opCode2 16rCB))) 22 | (jmp-near-rel 23 | opCode: uint8 24 | opCode2: uint8 25 | disp32: uint32 26 | (where (== opCode 16rE9) (== opCode2 16rCD))) 27 | (jmp-reg-direct 28 | opCode: uint8 29 | mod: (bitfield uint8 2) 30 | reg: (bitfield uint8 3) 31 | rm: (bitfield uint8 3) 32 | (where (== opCode 16rFF) (== mod 2r11) 33 | (== reg 2r100))) 34 | (jmp-imm-indirect 35 | opCode: uint8 36 | mod: (bitfield uint8 2) 37 | reg: (bitfield uint8 3) 38 | rm: (bitfield uint8 3) 39 | imm: uint32 40 | (where (== opCode 16rFF) (== mod 2r00) 41 | (== reg 2r100) (== rm 101)))) 42 | 43 | 44 | (import bitc.main as main) 45 | (import bitc.stdio as stdio) 46 | 47 | (provide bitc.main main) 48 | (define main.main:(fn (vector string) -> int32) 49 | (lambda (argvec) 50 | (define jump (jmp-reg-direct 2r000)) 51 | (switch x jump 52 | ((jmp-short-rel jmp-near-rel) 53 | (stdio.write-int stdio.stdout x.opCode 16) 54 | (stdio.write-int stdio.stdout x.opCode2 16)) 55 | ((jmp-reg-direct jmp-imm-indirect) 56 | (stdio.write-int stdio.stdout x.opCode 16) 57 | (stdio.write-int stdio.stdout 4:uint8 16))) 0)) 58 | -------------------------------------------------------------------------------- /src/tests/bugs/expect.mk: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # 3 | # Copyright (C) 2010, Jonathan S. Shapiro 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or 7 | # without modification, are permitted provided that the following 8 | # conditions are met: 9 | # 10 | # - Redistributions of source code must contain the above 11 | # copyright notice, this list of conditions, and the following 12 | # disclaimer. 13 | # 14 | # - Redistributions in binary form must reproduce the above 15 | # copyright notice, this list of conditions, and the following 16 | # disclaimer in the documentation and/or other materials 17 | # provided with the distribution. 18 | # 19 | # - Neither the names of the copyright holders nor the names of any 20 | # of any contributors may be used to endorse or promote products 21 | # derived from this software without specific prior written 22 | # permission. 23 | # 24 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | # 36 | ########################################################################## 37 | 38 | -------------------------------------------------------------------------------- /src/tests/defloop/ifa.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (interface ifa 40 | (proclaim a:uint32)) 41 | -------------------------------------------------------------------------------- /src/tests/defloop/ifb.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (interface ifb 40 | (proclaim b:uint32)) 41 | -------------------------------------------------------------------------------- /src/tests/defloop/srca.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (import ifb ifb) 40 | (provide ifa ifa) 41 | 42 | (define ifa.a ifb.b) 43 | 44 | (define (main) 45 | ifb.b 46 | ifa.a 47 | (the int32 0)) 48 | -------------------------------------------------------------------------------- /src/tests/defloop/srcb.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (import ifa ifa) 40 | (provide ifb ifb) 41 | 42 | (define ifb.b ifa.a) 43 | -------------------------------------------------------------------------------- /src/tests/general/acyclic.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | 40 | (define (f x) (f f)) 41 | -------------------------------------------------------------------------------- /src/tests/general/declbug.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | 39 | (bitc-version "0.9+") 40 | ;; Recursive Structures with Declare 41 | 42 | (defunion odd:ref) 43 | (defunion even:ref) 44 | (defunion odd:ref (ODD even)) 45 | (defunion even:ref (EVEN odd)) 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/tests/general/fixinit.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | 40 | (define x (the int32 100)) 41 | 42 | (define xx:int32 (if #t x 0)) 43 | 44 | (define xxy:int32 (begin x xx)) 45 | 46 | (define (main) (begin xx x xxy)) 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/tests/general/fnxn.bitc: -------------------------------------------------------------------------------- 1 | (provide main bitc.main) 2 | 3 | (define p:(bool, bool) (#t, #f)) 4 | 5 | ;(define (f x) 6 | ; (set! x^ p) 7 | ; ) 8 | 9 | (define f (lambda (x) 10 | (let ((p (lambda (y) x))) p))) 11 | 12 | ;val f: (forall 'a 'b 'c 'd 'e 'f 'g 'h 'i 'j 'k 'l 13 | ; *('K22446, (__letGather 'h|(fn ('i|'j) 'k|'c)), 14 | ; (__letGather 'l|((fn ('e|'f) 'g|'c)))) 15 | ; 16 | ; *('K22474, 'a|(fn ('b|'c) 'd|((fn ('e|'f) 'g|'c))), 17 | ; 'a|(fn ('b|'c) 'd|((fn ('e|'f) 'g|'c)))) ) 18 | ; 19 | ; 'a|(fn ('b|'c) 'd|((fn ('e|'f) 'g|'c)))) 20 | 21 | 22 | (define main.main:(fn ((vector string)) int32) 23 | (lambda (argvec) 0)) 24 | -------------------------------------------------------------------------------- /src/tests/general/iface.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.10") 39 | 40 | (interface iface 41 | (proclaim Xn: exception external) 42 | (proclaim extName:(fn () int32) external extName) 43 | (defunion unin Ctr1 Ctr2) 44 | ) 45 | -------------------------------------------------------------------------------- /src/tests/general/iface02.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | 40 | (deftypeclass (EQL 'a) 41 | ===: (fn ('a 'a) bool) 42 | ) 43 | 44 | -------------------------------------------------------------------------------- /src/tests/general/iface1.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | 40 | (define (ID x) x) 41 | -------------------------------------------------------------------------------- /src/tests/general/import.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (import l-if listif) 40 | -------------------------------------------------------------------------------- /src/tests/general/listif.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (interface listif 40 | (defunion (list 'a):ref 41 | nil 42 | (cons 'a (list 'a)))) 43 | -------------------------------------------------------------------------------- /src/tests/general/patbind.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | 40 | (define (f1 x) 41 | (let ((g (lambda (y) (tuple y x)))) 42 | g)) 43 | 44 | (define (f2 x) 45 | (let ((g (lambda (y) (tuple y x))) 46 | (h ())) 47 | (pair g h))) 48 | -------------------------------------------------------------------------------- /src/tests/general/seetypes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for i in `ls $@` ; do 3 | echo "- - - - - - $i - - - - - -"; 4 | cat $i; 5 | echo ""; 6 | echo $i | cut -f1 -d'.' | ../../frontend/BUILD/bitcc -I. -I../../runtime/ --showtypes `cat -` -o .typ.o $i ; 7 | echo ""; 8 | rm -f .typ.o 9 | done 10 | 11 | -------------------------------------------------------------------------------- /src/tests/general/unit-fn.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2008, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.10") 39 | 40 | (define (unitfn x:()) x) 41 | 42 | (provide main bitc.main) 43 | (define (main.main argv:(vector string)) 44 | 0:int32) 45 | -------------------------------------------------------------------------------- /src/tests/n-unit/alias.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2010, Jonathan S. Shapiro. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | bitc version 0.11 39 | 40 | import bitc.main main 41 | provide bitc.main main 42 | import bitc.stdio as stdio 43 | 44 | def main: (fn(string[]) -> int32) = 45 | lambda(argvec) 0 46 | -------------------------------------------------------------------------------- /src/tests/n-unit/basic.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2010, Jonathan S. Shapiro 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | bitc version 0.11 39 | 40 | // The simplest test 41 | import bitc.main as main 42 | provide bitc.main main 43 | 44 | def main.main:fn(string[]) -> int32 = 45 | lambda (argvec) 0 46 | -------------------------------------------------------------------------------- /src/tests/parse/expect.mk: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # 3 | # Copyright (C) 2010, Jonathan S. Shapiro 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or 7 | # without modification, are permitted provided that the following 8 | # conditions are met: 9 | # 10 | # - Redistributions of source code must contain the above 11 | # copyright notice, this list of conditions, and the following 12 | # disclaimer. 13 | # 14 | # - Redistributions in binary form must reproduce the above 15 | # copyright notice, this list of conditions, and the following 16 | # disclaimer in the documentation and/or other materials 17 | # provided with the distribution. 18 | # 19 | # - Neither the names of the copyright holders nor the names of any 20 | # of any contributors may be used to endorse or promote products 21 | # derived from this software without specific prior written 22 | # permission. 23 | # 24 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | # 36 | ########################################################################## 37 | 38 | BUILD/alltypes.test: TEST_MODE=compile 39 | BUILD/alltypes.bita: EXPECT_ERROUTPUT=missing-then.compile 40 | -------------------------------------------------------------------------------- /src/tests/parse/missing-then.bits: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argv: string[]) = { 43 | if true true 44 | 0:int32 45 | } 46 | -------------------------------------------------------------------------------- /src/tests/pretty/alltypes.compile: -------------------------------------------------------------------------------- 1 | alltypes.bits:46:2: WARNING: Local declaration of basic found here, but no definition found. 2 | alltypes.bits:72:2: WARNING: Local declaration of primaries found here, but no definition found. 3 | alltypes.bits:81:2: WARNING: Local declaration of shallowperm found here, but no definition found. 4 | alltypes.bits:84:2: WARNING: Local declaration of postfix found here, but no definition found. 5 | alltypes.bits:88:2: WARNING: Local declaration of prefix found here, but no definition found. 6 | alltypes.bits:91:2: WARNING: Local declaration of fntype found here, but no definition found. 7 | alltypes.bits:95:2: WARNING: Local declaration of RefArgTypes found here, but no definition found. 8 | -------------------------------------------------------------------------------- /src/tests/pretty/alltypes.link: -------------------------------------------------------------------------------- 1 | BUILD/alltypes.bita:6:3: WARNING: Local declaration of basic found here, but no definition found. 2 | BUILD/alltypes.bita:17:3: WARNING: Local declaration of primaries found here, but no definition found. 3 | BUILD/alltypes.bita:19:3: WARNING: Local declaration of shallowperm found here, but no definition found. 4 | BUILD/alltypes.bita:21:3: WARNING: Local declaration of postfix found here, but no definition found. 5 | BUILD/alltypes.bita:23:3: WARNING: Local declaration of prefix found here, but no definition found. 6 | BUILD/alltypes.bita:25:3: WARNING: Local declaration of fntype found here, but no definition found. 7 | BUILD/alltypes.bita:27:3: WARNING: Local declaration of RefArgTypes found here, but no definition found. 8 | gcc -std=gnu99 -c -O -I ../../libbitc -o bitc.out.o bitc.out.c 9 | gcc -O -I ../../libbitc --nostdlib -o BUILD/alltypes bitc.out.o ../../libbitc/BUILD/libbitc.a -lgc 10 | -------------------------------------------------------------------------------- /src/tests/pretty/excpt.bits: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | module exception_test is 41 | import bitc.stdio as stdio 42 | import bitc.stdlib as stdlib 43 | 44 | exception exFred 45 | 46 | exception exWilma is 47 | i : int32 48 | j : bool 49 | -------------------------------------------------------------------------------- /src/tests/pretty/expect.mk: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # 3 | # Copyright (C) 2010, Jonathan S. Shapiro 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or 7 | # without modification, are permitted provided that the following 8 | # conditions are met: 9 | # 10 | # - Redistributions of source code must contain the above 11 | # copyright notice, this list of conditions, and the following 12 | # disclaimer. 13 | # 14 | # - Redistributions in binary form must reproduce the above 15 | # copyright notice, this list of conditions, and the following 16 | # disclaimer in the documentation and/or other materials 17 | # provided with the distribution. 18 | # 19 | # - Neither the names of the copyright holders nor the names of any 20 | # of any contributors may be used to endorse or promote products 21 | # derived from this software without specific prior written 22 | # permission. 23 | # 24 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | # 36 | ########################################################################## 37 | 38 | BUILD/alltypes: EXPECT_ERROUTPUT=alltypes.link 39 | BUILD/alltypes.bita: EXPECT_ERROUTPUT=alltypes.compile 40 | -------------------------------------------------------------------------------- /src/tests/pretty/fn.bits: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | module sha1_impl is 41 | import bitc.stdio as stdio 42 | import bitc.stdlib as stdlib 43 | 44 | // Define the SHA1 circular left shift operation 45 | def id(x) = x 46 | 47 | def f(x,y) = y 48 | -------------------------------------------------------------------------------- /src/tests/pretty/main.bits: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | module main_test is 41 | import bitc.main as main 42 | provide bitc.main main 43 | 44 | def main.main(argv: string[]) = { 45 | 0:int32 46 | } 47 | -------------------------------------------------------------------------------- /src/tests/reachbug/ifa.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (interface ifa 40 | (proclaim a:uint32)) 41 | -------------------------------------------------------------------------------- /src/tests/reachbug/ifb.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (interface ifb 40 | (proclaim b:uint32)) 41 | -------------------------------------------------------------------------------- /src/tests/reachbug/srca.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (import ifb ifb) 40 | (provide ifa ifa) 41 | 42 | (define ifa.a ifb.b) 43 | 44 | (define (main) 45 | ifb.b 46 | ifa.a 47 | (the int32 0)) 48 | -------------------------------------------------------------------------------- /src/tests/reachbug/srcb.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.9+") 39 | (import ifa ifa) 40 | (provide ifb ifb) 41 | 42 | (define ifb.b (the uint32 1)) 43 | -------------------------------------------------------------------------------- /src/tests/stale/defpair.bitc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; Copyright (C) 2006, Johns Hopkins University. 4 | ;; All rights reserved. 5 | ;; 6 | ;; Redistribution and use in source and binary forms, with or 7 | ;; without modification, are permitted provided that the following 8 | ;; conditions are met: 9 | ;; 10 | ;; - Redistributions of source code must contain the above 11 | ;; copyright notice, this list of conditions, and the following 12 | ;; disclaimer. 13 | ;; 14 | ;; - Redistributions in binary form must reproduce the above 15 | ;; copyright notice, this list of conditions, and the following 16 | ;; disclaimer in the documentation and/or other materials 17 | ;; provided with the distribution. 18 | ;; 19 | ;; - Neither the names of the copyright holders nor the names of any 20 | ;; of any contributors may be used to endorse or promote products 21 | ;; derived from this software without specific prior written 22 | ;; permission. 23 | ;; 24 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ;; 36 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37 | 38 | (bitc-version "0.10") 39 | (provide main bitc.main) 40 | 41 | (define (a,b) (0:int32,1:int32)) 42 | 43 | (define (main.main argVec:(vector string)) 44 | a) 45 | -------------------------------------------------------------------------------- /src/tests/unit/ArithInst.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argvec: string[]) 43 | in 44 | if (1:int32) == 1 then 0 else 1:int32 45 | -------------------------------------------------------------------------------- /src/tests/unit/CMangle.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def $ = 100:int32 43 | def $@%<> = 25:int32 44 | 45 | def main.main(argVec: string[]) 46 | in 47 | $ + $@%<> 48 | 0:int32 49 | -------------------------------------------------------------------------------- /src/tests/unit/Echo_Args.stdout: -------------------------------------------------------------------------------- 1 | ./BUILD/Echo_Args 2 | -------------------------------------------------------------------------------- /src/tests/unit/Loc2.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | def id(x) = x 40 | 41 | import bitc.main as main 42 | provide bitc.main main 43 | 44 | def main.main(argvec: string[]) 45 | in 46 | array(id(0:int32), id(id(0)), 0)[1] 47 | -------------------------------------------------------------------------------- /src/tests/unit/TagType.bitc.fixme: -------------------------------------------------------------------------------- 1 | (bitc-version "0.9+") 2 | 3 | (import stdio bitc.stdio) 4 | 5 | (defunion (mylist 'a) 6 | (declare (tag-type uint8)) 7 | mynil 8 | (mycons car:'a cdr:(mylist 'a))) 9 | 10 | (define i0 (the int32 0)) 11 | (define i1 (the int32 1)) 12 | 13 | (defunion myUnin 14 | (declare (tag-type (bitfield uint32 2))) 15 | mc10 16 | mc11 17 | (mc12 u:myUnin) 18 | ) 19 | 20 | (defunion myUnin2 21 | mc21 22 | mc22 23 | mc23 24 | (mc24 u:myUnin2) 25 | ) 26 | 27 | (defunion myUnin3 28 | (mc31 i:int32 b1:bool b2:bool) 29 | ) 30 | 31 | (defunion myUnin4 32 | mc41 33 | ) 34 | 35 | (define (main argVec:(vector string)) 36 | (begin 37 | mc10 38 | (stdio.write-int32 stdio.stdout 39 | (case (mc24 mc21) 40 | (mc21 (the int32 21)) 41 | (mc22 22) 42 | (mc23 23) 43 | ((mc24 x) 24))) 44 | (stdio.write-char stdio.stdout #\{linefeed}) 45 | (mc31 10 #t #f) 46 | mc41 47 | (mycons i0 (mycons i1 mynil)) 48 | i0)) 49 | -------------------------------------------------------------------------------- /src/tests/unit/UncaughtException.stdout: -------------------------------------------------------------------------------- 1 | Uncaught exFred exception raised at UncaughtException.bitc:51 2 | -------------------------------------------------------------------------------- /src/tests/unit/VecBoundsError.stdout: -------------------------------------------------------------------------------- 1 | Uncaught IndexBoundsError exception raised at VecBoundsError.bitc:46 2 | -------------------------------------------------------------------------------- /src/tests/unit/Vector.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argvec: string[]) 43 | in 44 | vector(true, false, true).length 45 | MakeVector(25, lambda(n) { 0:int32 })[10] 46 | -------------------------------------------------------------------------------- /src/tests/unit/alias.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main main 40 | provide bitc.main main 41 | import bitc.stdio as stdio 42 | 43 | def main(args: string[]) 44 | in 45 | 0 : int32 46 | -------------------------------------------------------------------------------- /src/tests/unit/badsyntax.bitc: -------------------------------------------------------------------------------- 1 | bitc version 0.11 2 | // bitc 0.11 3 | 4 | bad input 5 | -------------------------------------------------------------------------------- /src/tests/unit/badsyntax.errout: -------------------------------------------------------------------------------- 1 | badsyntax.bitc:4:0: Syntax error in input: unexpected "bad" 2 | -------------------------------------------------------------------------------- /src/tests/unit/basic.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | // The simplest test 41 | 42 | import bitc.main as main 43 | provide bitc.main main 44 | def main.main(argvec : string[]) 45 | in 46 | 0:int32 47 | -------------------------------------------------------------------------------- /src/tests/unit/bindmethod.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def a23 = _==_ 43 | 44 | def main.main(argvec : string[]) 45 | in 46 | a23(true, true) 47 | 0:int32 48 | -------------------------------------------------------------------------------- /src/tests/unit/bitset.stdout: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 32 4 | 2 5 | 1 6 | 160 7 | 1 8 | 1 9 | 128 10 | !Contains 5 (and shouldn't) 11 | Contains 31 (and should) 12 | -------------------------------------------------------------------------------- /src/tests/unit/block.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argVec: string[]) 43 | in 44 | label L 45 | in if true then from L return 0:int32 else 25:int32 46 | -------------------------------------------------------------------------------- /src/tests/unit/boolnot.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argvec : string[]) 43 | in 44 | if (!true == false) && (not true == false) 45 | then 0 46 | else 1 : int32 47 | -------------------------------------------------------------------------------- /src/tests/unit/closure.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | import bitc.main as main 41 | provide bitc.main main 42 | 43 | def f = lambda (x) { lambda(y) {x + y} } 44 | 45 | def main.main(argvec: string[]) 46 | in 47 | f(1:int32)(2) 48 | -------------------------------------------------------------------------------- /src/tests/unit/cyclic.errout: -------------------------------------------------------------------------------- 1 | cyclic.bitc:48:2: WARNING: Local declaration of array_on_field found here, but no definition found. 2 | gcc -std=gnu99 -c -O -I ../../libbitc -o bitc.out.o bitc.out.c 3 | gcc -O -I ../../libbitc --nostdlib -o BUILD/cyclic bitc.out.o ../../libbitc/BUILD/libbitc.a -lgc 4 | -------------------------------------------------------------------------------- /src/tests/unit/echo-char.stdin: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /src/tests/unit/echo-char.stdout: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /src/tests/unit/from-all.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | import bitc.main 41 | import bitc.list 42 | provide bitc.main main 43 | 44 | def main(argvec: string[]) 45 | in 46 | map(lambda (x) {x}, cons(true, nil)) 47 | 0:int32 48 | 49 | -------------------------------------------------------------------------------- /src/tests/unit/from.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | import bitc.main main 41 | provide bitc.main main 42 | import bitc.list MAP=map 43 | 44 | def main(argvec: string[]) 45 | in 46 | MAP(lambda (x) {x}, cons(true, nil)) 47 | 0:int32 48 | 49 | -------------------------------------------------------------------------------- /src/tests/unit/hello.stdout: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | -------------------------------------------------------------------------------- /src/tests/unit/import_path.bitc: -------------------------------------------------------------------------------- 1 | bitc version 0.11 2 | import test_import.bad_interface 3 | def main.main(argv:string 4 | in 5 | 0:int32 6 | -------------------------------------------------------------------------------- /src/tests/unit/import_path.errout: -------------------------------------------------------------------------------- 1 | import_path.bitc:2:0: Unable to import test_import.bad_interface 2 | import_path.bitc:4:0: Syntax error in input: unexpected "in" 3 | -------------------------------------------------------------------------------- /src/tests/unit/inf.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def f(x) = f(x) 43 | 44 | def main.main(argvec: string[]) 45 | in 46 | f 47 | 0:int32 48 | -------------------------------------------------------------------------------- /src/tests/unit/innerdef.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argvec: string[]) 43 | in 44 | def f(x) = x 45 | f(0:int32) 46 | -------------------------------------------------------------------------------- /src/tests/unit/intout.stdout: -------------------------------------------------------------------------------- 1 | 10 2 | faceabcd 3 | 303240 4 | 0 5 | -12345 6 | -------------------------------------------------------------------------------- /src/tests/unit/layout-top-explicit.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | { 39 | bitc version 0.11 40 | 41 | import bitc.main as main 42 | provide bitc.main main 43 | 44 | def main.main(argv: string[]) = 0:int32 45 | } 46 | -------------------------------------------------------------------------------- /src/tests/unit/layout-top-implicit.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | import bitc.main as main 41 | provide bitc.main main 42 | 43 | def main.main(argv: string[]) = 0:int32 44 | -------------------------------------------------------------------------------- /src/tests/unit/libbitc-bita.bitc: -------------------------------------------------------------------------------- 1 | // The interesting part of this is in the makefile, which adds 2 | // libbitc.bita to the command line so that the compiler will be 3 | // forced to ingest that. The purpose of the test is to ensure that 4 | // libbitc.bita is well-formed and parseable. 5 | bitc version 0.11 6 | import bitc.main as main 7 | provide bitc.main main 8 | 9 | def main.main(argvec: string[]) 10 | in 11 | 0:int32 12 | -------------------------------------------------------------------------------- /src/tests/unit/main-simple.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008, The EROS Group, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argvec: string[]) 43 | in 44 | 0:int32 45 | -------------------------------------------------------------------------------- /src/tests/unit/newException.stdout: -------------------------------------------------------------------------------- 1 | Uncaught Xn exception raised at newException.bitc:50 2 | -------------------------------------------------------------------------------- /src/tests/unit/not.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argvec: string[]) 43 | in 44 | if not false then 0 else 1:int32 45 | -------------------------------------------------------------------------------- /src/tests/unit/nunion-case.bitc.fixme: -------------------------------------------------------------------------------- 1 | (bitc-version "0.9+") 2 | 3 | (defunion (unin 'a) (C a:'a)) 4 | 5 | (define (f x) 6 | (case x 7 | ((C y) (the int32 y)))) 8 | 9 | (define (main argv:(vector string)) 10 | f 11 | (the int32 0) 12 | ) 13 | -------------------------------------------------------------------------------- /src/tests/unit/ret-fun.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def id(x) = x 43 | 44 | def idf() = id 45 | 46 | def main.main(argvec: string[]) 47 | in 48 | idf 49 | 0:int32 50 | 51 | -------------------------------------------------------------------------------- /src/tests/unit/seetypes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for i in `ls $@` ; do 3 | #echo "- - - - - - $i - - - - - -"; 4 | #cat $i; 5 | #echo ""; 6 | echo $i | cut -f1 -d'.' | ../../compiler/BUILD/bitcc \ 7 | -I . -I ../../libbitc/ --nostdlib --showtypes `cat -` -o .typ.o $i ; 8 | echo ""; 9 | rm -f .typ.o 10 | done 11 | 12 | -------------------------------------------------------------------------------- /src/tests/unit/sha1-file.stdout: -------------------------------------------------------------------------------- 1 | e4 f2 23 e6 6e c df 51 ac 9e 74 d9 f8 3d f9 4c 47 f3 3c 49 2 | -------------------------------------------------------------------------------- /src/tests/unit/sha1-test.stdout: -------------------------------------------------------------------------------- 1 | 28 22 87 36 99 14 19 25 18 35 aa cf 17 8c 47 66 56 d9 1d d7 2 | -------------------------------------------------------------------------------- /src/tests/unit/sizeof.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def main.main(argvec: string[]) 43 | in 44 | convert(sizeof(int32)) : int32 45 | -------------------------------------------------------------------------------- /src/tests/unit/string-lex.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, The EROS Group, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.main as main 40 | provide bitc.main main 41 | 42 | def s = "This string should be terminated. 43 | 44 | def main.main(argv: string[]) 45 | in 46 | 0:int32 47 | -------------------------------------------------------------------------------- /src/tests/unit/string-lex.errout: -------------------------------------------------------------------------------- 1 | string-lex.bitc:42:8: Unterminated string constant. Missing end quote? 2 | string-lex.bitc:42:8: Syntax error in input: unexpected '}' (possibly inserted by layout) 3 | -------------------------------------------------------------------------------- /src/tests/unit/switch-unify.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2006, Johns Hopkins University. 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | import bitc.list as lst 40 | import bitc.main as main 41 | provide bitc.main main 42 | 43 | def main.main(argvec: string[]) 44 | in 45 | lst.list_length(nil:list(char)) 46 | 0:int32 47 | -------------------------------------------------------------------------------- /src/tests/unit/test_import/bad_interface.bitc: -------------------------------------------------------------------------------- 1 | bitc version 0.11 2 | interface bad_interface 3 | is 4 | def something:int32 5 | -------------------------------------------------------------------------------- /src/tests/unit/twomodule.stdout: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /src/tests/unit/unresolved.bitc: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2010, Jonathan S. Shapiro 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or 7 | // without modification, are permitted provided that the following 8 | // conditions are met: 9 | // 10 | // - Redistributions of source code must contain the above 11 | // copyright notice, this list of conditions, and the following 12 | // disclaimer. 13 | // 14 | // - Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions, and the following 16 | // disclaimer in the documentation and/or other materials 17 | // provided with the distribution. 18 | // 19 | // - Neither the names of the copyright holders nor the names of any 20 | // of any contributors may be used to endorse or promote products 21 | // derived from this software without specific prior written 22 | // permission. 23 | // 24 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | // 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | bitc version 0.11 39 | 40 | import bitc.main as main 41 | provide bitc.main main 42 | 43 | def main.main(argv: string[]) 44 | in 45 | (0:int32) + 4 46 | 47 | 0:int32 48 | -------------------------------------------------------------------------------- /src/tests/unit/usesel-unbound.bitc: -------------------------------------------------------------------------------- 1 | bitc version 0.11 2 | import bitc.main as main 3 | import bitc.stdio // as stdio 4 | import bitc.list // as lst 5 | provide bitc.main main 6 | 7 | def main.main(argv : string[]) 8 | in 9 | let x = cons("using lst.* and stdio.* when importing list and stdio to global scope\n", nil) 10 | in 11 | lst.map(lambda(s) { stdio.write_string(stdio.stdout, foo.car(cons(s, mil))) }, 12 | x) 13 | 0:int32 14 | -------------------------------------------------------------------------------- /src/tests/unit/usesel-unbound.errout: -------------------------------------------------------------------------------- 1 | usesel-unbound.bitc:11:4: Identifier `lst' is undefined. Are you missing the name on an import statement? 2 | usesel-unbound.bitc:11:24: Identifier `stdio' used here, Undefined. 3 | usesel-unbound.bitc:11:24: Identifier `stdio' is undefined. 4 | usesel-unbound.bitc:11:43: Identifier `stdio' used here, Undefined. 5 | usesel-unbound.bitc:11:43: Identifier `stdio' is undefined. 6 | usesel-unbound.bitc:11:57: Identifier `foo' used here, Undefined. 7 | usesel-unbound.bitc:11:57: Identifier `foo' is undefined. 8 | usesel-unbound.bitc:11:73: Identifier `mil' used here, Undefined. 9 | Exiting due to errors during Symbol Resolution 10 | -------------------------------------------------------------------------------- /src/tests/unit/utf8echo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # utf8echo: echo statement with 'U+NNNN[N]' meaning utf-8 codepoint NNNN[N] 3 | # To express U+NNNNN literally, type it as UU+NNNNN. 4 | # If a space follows the U+NNNNN, eat it. This is for readability - so you 5 | # can type utf8echo 'U+0065 U+0301' and get e with combining acute accent. 6 | 7 | my $str = join ' ', @ARGV; 8 | 9 | while ($str =~ m/(?