├── .gitignore
├── GNUmakefile
├── Jenkinsfile
├── Makefile
├── README.md
├── battery.toml
├── doc
├── .gitignore
├── Doxygen
├── DoxygenLayout.xml
├── _config.json
├── _includes
│ └── content.md
├── cloc-lang-def.txt
├── codeguidelines.rst
├── errors.md
├── index.md
├── mangle.md
├── overview.md
├── syntax.md
├── volt.md
├── warnings.txt
└── warts.txt
├── dsupport
├── battery.toml
└── src
│ ├── core
│ └── c
│ │ └── time.d
│ ├── undead
│ ├── cstream.d
│ ├── internal
│ │ └── file.d
│ ├── stream.d
│ └── utf.d
│ ├── volta_dsupport_dummy.volt
│ └── watt
│ ├── algorithm.d
│ ├── containers
│ └── stack.d
│ ├── conv.d
│ ├── io
│ ├── file.d
│ ├── monotonic.d
│ ├── std.d
│ └── streams.d
│ ├── math
│ └── random.d
│ ├── path.d
│ ├── process.d
│ └── text
│ ├── ascii.d
│ ├── diff.d
│ ├── format.d
│ ├── sink.d
│ ├── string.d
│ ├── utf.d
│ └── vdoc.d
├── lib
├── battery.toml
└── src
│ └── volta
│ ├── errors.d
│ ├── interfaces.d
│ ├── ir
│ ├── base.d
│ ├── context.d
│ ├── declaration.d
│ ├── expression.d
│ ├── location.d
│ ├── package.d
│ ├── printer.d
│ ├── statement.d
│ ├── templates.d
│ ├── token.d
│ ├── tokenstream.d
│ ├── toplevel.d
│ └── type.d
│ ├── license.d
│ ├── parser
│ ├── base.d
│ ├── declaration.d
│ ├── errors.d
│ ├── expression.d
│ ├── intir.d
│ ├── parser.d
│ ├── statements.d
│ ├── templates.d
│ └── toplevel.d
│ ├── postparse
│ ├── attribremoval.d
│ ├── condremoval.d
│ ├── gatherer.d
│ ├── importresolver.d
│ ├── missing.d
│ ├── pass.d
│ └── scopereplacer.d
│ ├── settings.d
│ ├── token
│ ├── error.d
│ ├── lexer.d
│ ├── source.d
│ └── writer.d
│ ├── util
│ ├── copy.d
│ ├── dup.d
│ ├── errormessages.d
│ ├── moduleFromScope.d
│ ├── sinks.d
│ ├── stack.d
│ ├── string.d
│ └── util.d
│ └── visitor
│ ├── package.d
│ ├── scopemanager.d
│ ├── setExpLocationVisitor.d
│ └── visitor.d
├── rt
├── battery.toml
├── doc
│ └── index.md
├── src
│ ├── core
│ │ ├── c
│ │ │ ├── config.volt
│ │ │ ├── errno.c
│ │ │ ├── errno.volt
│ │ │ ├── osx
│ │ │ │ └── package.volt
│ │ │ ├── package.volt
│ │ │ ├── posix
│ │ │ │ ├── arpa
│ │ │ │ │ └── inet.volt
│ │ │ │ ├── config.volt
│ │ │ │ ├── dirent.volt
│ │ │ │ ├── dlfcn.volt
│ │ │ │ ├── fcntl.volt
│ │ │ │ ├── netdb.volt
│ │ │ │ ├── netinet
│ │ │ │ │ ├── in_.volt
│ │ │ │ │ └── tcp.volt
│ │ │ │ ├── package.volt
│ │ │ │ ├── spawn.volt
│ │ │ │ ├── sys
│ │ │ │ │ ├── select.volt
│ │ │ │ │ ├── socket.volt
│ │ │ │ │ ├── stat.volt
│ │ │ │ │ ├── stdlib.volt
│ │ │ │ │ ├── time.volt
│ │ │ │ │ ├── types.volt
│ │ │ │ │ ├── uio.volt
│ │ │ │ │ ├── un.volt
│ │ │ │ │ └── wait.volt
│ │ │ │ ├── time.volt
│ │ │ │ └── unistd.volt
│ │ │ ├── pthread.volt
│ │ │ ├── signal.volt
│ │ │ ├── stdarg.volt
│ │ │ ├── stddef.volt
│ │ │ ├── stdint.volt
│ │ │ ├── stdio.volt
│ │ │ ├── stdlib.volt
│ │ │ ├── string.volt
│ │ │ ├── time.volt
│ │ │ ├── wchar_.volt
│ │ │ └── windows
│ │ │ │ ├── package.volt
│ │ │ │ ├── vk.volt
│ │ │ │ ├── wgl.volt
│ │ │ │ ├── windows.volt
│ │ │ │ ├── winhttp.volt
│ │ │ │ └── winsock2.volt
│ │ ├── compiler
│ │ │ ├── defaultsymbols.volt
│ │ │ └── llvm.volt
│ │ ├── exception.volt
│ │ ├── object.volt
│ │ ├── rt
│ │ │ ├── aa.volt
│ │ │ ├── eh.volt
│ │ │ ├── format.volt
│ │ │ ├── gc.volt
│ │ │ ├── misc.volt
│ │ │ └── thread.volt
│ │ ├── typeinfo.volt
│ │ └── varargs.volt
│ └── vrt
│ │ ├── aarch64.s
│ │ ├── aarch64_macos.s
│ │ ├── armhf.s
│ │ ├── ext
│ │ ├── dwarf.volt
│ │ ├── stdc.volt
│ │ └── unwind.volt
│ │ ├── gc
│ │ ├── arena.volt
│ │ ├── design.volt
│ │ ├── entry.volt
│ │ ├── errors.volt
│ │ ├── extent.volt
│ │ ├── hit.volt
│ │ ├── large.volt
│ │ ├── linkednode.volt
│ │ ├── manager
│ │ │ ├── gigaman.volt
│ │ │ ├── package.volt
│ │ │ ├── pagetable.volt
│ │ │ └── rbman.volt
│ │ ├── mman
│ │ │ ├── mmap.volt
│ │ │ ├── package.volt
│ │ │ └── windows.volt
│ │ ├── rbtree.volt
│ │ ├── save_regs.asm
│ │ ├── sbrk.volt
│ │ ├── sections
│ │ │ ├── linux.volt
│ │ │ ├── osx.volt
│ │ │ ├── package.volt
│ │ │ └── windows.volt
│ │ ├── slab.volt
│ │ └── util
│ │ │ ├── buddy.volt
│ │ │ └── package.volt
│ │ ├── os
│ │ ├── eh.asm
│ │ ├── eh
│ │ │ ├── common.volt
│ │ │ ├── stub.volt
│ │ │ ├── unwind.volt
│ │ │ └── windows.volt
│ │ ├── gtors.volt
│ │ ├── monotonic.volt
│ │ ├── panic.volt
│ │ └── thread.volt
│ │ └── vacuum
│ │ ├── aa.volt
│ │ ├── clazz.volt
│ │ ├── defines.volt
│ │ ├── format.volt
│ │ ├── hash.volt
│ │ ├── utf.volt
│ │ └── vmain.volt
└── test
│ ├── aa
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ ├── 027
│ │ └── test.volt
│ ├── enumAsKey
│ │ └── test.volt
│ └── structs
│ │ ├── 001
│ │ └── test.volt
│ │ ├── 002
│ │ └── test.volt
│ │ ├── 003
│ │ └── test.volt
│ │ ├── 004
│ │ └── test.volt
│ │ ├── 005
│ │ └── test.volt
│ │ └── 006
│ │ └── test.volt
│ ├── abi
│ ├── amd64sysv
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── 015
│ │ │ └── test.volt
│ │ ├── 016
│ │ │ └── test.volt
│ │ ├── 017
│ │ │ └── test.volt
│ │ ├── 018
│ │ │ └── test.volt
│ │ ├── 019
│ │ │ └── test.volt
│ │ ├── 020
│ │ │ └── test.volt
│ │ ├── 021
│ │ │ └── test.volt
│ │ ├── 022
│ │ │ └── test.volt
│ │ ├── 023
│ │ │ └── test.volt
│ │ ├── 024
│ │ │ └── test.volt
│ │ ├── 025
│ │ │ └── test.volt
│ │ ├── 026
│ │ │ └── test.volt
│ │ ├── 027
│ │ │ └── test.volt
│ │ ├── 028
│ │ │ └── test.volt
│ │ └── 029
│ │ │ └── test.volt
│ ├── amd64win
│ │ ├── 001
│ │ │ ├── abitest.c
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ ├── abitest.c
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ ├── abitest.c
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ ├── abitest.c
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ └── 007
│ │ │ ├── abitest.c
│ │ │ └── test.volt
│ └── ia32lin
│ │ └── 001
│ │ ├── abitest.c
│ │ └── test.volt
│ ├── aggregate
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ ├── 027
│ │ └── test.volt
│ ├── 028
│ │ └── test.volt
│ ├── 029
│ │ └── test.volt
│ ├── 030
│ │ └── test.volt
│ ├── 031
│ │ └── test.volt
│ ├── 032
│ │ └── test.volt
│ ├── 033
│ │ └── test.volt
│ ├── 034
│ │ └── test.volt
│ ├── 035
│ │ └── test.volt
│ ├── 036
│ │ └── test.volt
│ ├── 037
│ │ └── test.volt
│ ├── 038
│ │ └── test.volt
│ ├── 039
│ │ └── test.volt
│ ├── 040
│ │ └── test.volt
│ ├── 041
│ │ └── test.volt
│ ├── 042
│ │ └── test.volt
│ ├── 043
│ │ └── test.volt
│ ├── 044
│ │ └── test.volt
│ ├── 045
│ │ └── test.volt
│ ├── 046
│ │ └── test.volt
│ ├── 047
│ │ └── test.volt
│ ├── 048
│ │ └── test.volt
│ ├── 049
│ │ └── test.volt
│ ├── 050
│ │ └── test.volt
│ └── deps
│ │ └── theclass.volt
│ ├── arrays
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ ├── 027
│ │ └── test.volt
│ ├── 028
│ │ └── test.volt
│ ├── 029
│ │ └── test.volt
│ ├── 030
│ │ └── test.volt
│ ├── 031
│ │ └── test.volt
│ ├── 032
│ │ └── test.volt
│ ├── 033
│ │ └── test.volt
│ ├── 034
│ │ └── test.volt
│ ├── 035
│ │ └── test.volt
│ ├── 036
│ │ └── test.volt
│ ├── 037
│ │ └── test.volt
│ ├── 038
│ │ └── test.volt
│ ├── 039
│ │ └── test.volt
│ ├── 040
│ │ └── test.volt
│ ├── 041
│ │ └── test.volt
│ ├── 042
│ │ └── test.volt
│ ├── 043
│ │ └── test.volt
│ ├── 044
│ │ └── test.volt
│ ├── 045
│ │ └── test.volt
│ ├── comparisons
│ │ └── test.volt
│ └── staticArrays
│ │ └── immutableStaticArrayOfStrings
│ │ └── test.volt
│ ├── battery.tests.json
│ ├── bugs
│ ├── aa
│ │ ├── 001
│ │ │ └── test.volt
│ │ └── 002
│ │ │ └── test.volt
│ ├── arrays
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── sliceBug
│ │ │ └── test.volt
│ │ └── staticSliceBug
│ │ │ └── test.volt
│ ├── conversion
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ └── 013
│ │ │ └── test.volt
│ ├── declaration
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── 015
│ │ │ └── test.volt
│ │ ├── 016
│ │ │ └── test.volt
│ │ ├── 017
│ │ │ └── test.volt
│ │ ├── 018
│ │ │ └── test.volt
│ │ ├── 019
│ │ │ └── test.volt
│ │ ├── 020
│ │ │ └── test.volt
│ │ ├── 021
│ │ │ └── test.volt
│ │ ├── 022
│ │ │ └── test.volt
│ │ ├── 023
│ │ │ └── test.volt
│ │ ├── 024
│ │ │ └── test.volt
│ │ ├── 025
│ │ │ └── test.volt
│ │ ├── 026
│ │ │ └── test.volt
│ │ ├── 027
│ │ │ └── test.volt
│ │ ├── 028
│ │ │ └── test.volt
│ │ ├── 029
│ │ │ └── test.volt
│ │ ├── 030
│ │ │ └── test.volt
│ │ ├── 031
│ │ │ └── test.volt
│ │ ├── 032
│ │ │ └── test.volt
│ │ ├── 033
│ │ │ └── test.volt
│ │ ├── 034
│ │ │ └── test.volt
│ │ ├── 035
│ │ │ └── test.volt
│ │ ├── 036
│ │ │ └── test.volt
│ │ ├── 037
│ │ │ └── test.volt
│ │ └── 038
│ │ │ └── test.volt
│ ├── expression
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── 015
│ │ │ └── test.volt
│ │ ├── 016
│ │ │ └── test.volt
│ │ ├── 017
│ │ │ └── test.volt
│ │ ├── 018
│ │ │ └── test.volt
│ │ ├── 019
│ │ │ └── test.volt
│ │ ├── 020
│ │ │ └── test.volt
│ │ ├── 021
│ │ │ └── test.volt
│ │ ├── 022
│ │ │ └── test.volt
│ │ ├── 023
│ │ │ └── test.volt
│ │ ├── 024
│ │ │ └── test.volt
│ │ ├── 025
│ │ │ └── test.volt
│ │ ├── 026
│ │ │ └── test.volt
│ │ ├── 027
│ │ │ └── test.volt
│ │ ├── 028
│ │ │ └── test.volt
│ │ ├── 029
│ │ │ └── test.volt
│ │ ├── 030
│ │ │ └── test.volt
│ │ ├── 031
│ │ │ └── test.volt
│ │ ├── 032
│ │ │ └── test.volt
│ │ ├── 033
│ │ │ └── test.volt
│ │ ├── 034
│ │ │ └── test.volt
│ │ ├── 035
│ │ │ └── test.volt
│ │ ├── 036
│ │ │ └── test.volt
│ │ ├── 037
│ │ │ └── test.volt
│ │ ├── 038
│ │ │ └── test.volt
│ │ ├── 039
│ │ │ └── test.volt
│ │ ├── 040
│ │ │ └── test.volt
│ │ ├── 041
│ │ │ └── test.volt
│ │ ├── 042
│ │ │ └── test.volt
│ │ ├── 043
│ │ │ └── test.volt
│ │ ├── 044
│ │ │ └── test.volt
│ │ ├── 045
│ │ │ └── test.volt
│ │ ├── 046
│ │ │ └── test.volt
│ │ ├── 047
│ │ │ └── test.volt
│ │ ├── 048
│ │ │ └── test.volt
│ │ ├── 049
│ │ │ └── test.volt
│ │ ├── 050
│ │ │ └── test.volt
│ │ ├── 051
│ │ │ └── test.volt
│ │ ├── 052
│ │ │ └── test.volt
│ │ ├── 053
│ │ │ └── test.volt
│ │ └── 054
│ │ │ └── test.volt
│ ├── function
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ └── 013
│ │ │ └── test.volt
│ ├── import
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── attributeBug
│ │ │ └── test.volt
│ │ └── deps
│ │ │ ├── a.volt
│ │ │ ├── b.volt
│ │ │ ├── c.volt
│ │ │ ├── d.volt
│ │ │ └── ol.volt
│ ├── llvm
│ │ ├── 001
│ │ │ └── test.volt
│ │ └── 002
│ │ │ └── test.volt
│ ├── lookup
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── 015
│ │ │ └── test.volt
│ │ ├── 016
│ │ │ └── test.volt
│ │ ├── 017
│ │ │ └── test.volt
│ │ ├── 018
│ │ │ └── test.volt
│ │ └── invalidSameNameField
│ │ │ └── test.volt
│ ├── nested
│ │ └── 001
│ │ │ └── test.volt
│ ├── parse
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ └── 003
│ │ │ └── test.volt
│ └── template
│ │ └── 001
│ │ └── test.volt
│ ├── cfg
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── infiniteDoWhile
│ │ └── test.volt
│ └── infiniteDoWhileFailure
│ │ └── test.volt
│ ├── compiletime
│ ├── cond
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ └── 006
│ │ │ └── test.volt
│ └── exps
│ │ ├── 001
│ │ └── test.volt
│ │ └── 002
│ │ └── test.volt
│ ├── ctfe
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ └── i32Mod
│ │ └── test.volt
│ ├── doccomments
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ └── 005
│ │ └── test.volt
│ ├── enum
│ ├── badConstantString
│ │ └── test.volt
│ ├── noAssignString
│ │ └── test.volt
│ ├── nonConstantString
│ │ └── test.volt
│ ├── simpleBool
│ │ └── test.volt
│ └── simpleString
│ │ └── test.volt
│ ├── errors
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ ├── 027
│ │ └── test.volt
│ ├── 028
│ │ └── test.volt
│ ├── 029
│ │ └── test.volt
│ ├── 030
│ │ └── test.volt
│ ├── 031
│ │ └── test.volt
│ ├── 032
│ │ └── test.volt
│ ├── 033
│ │ └── test.volt
│ ├── 034
│ │ └── test.volt
│ ├── 035
│ │ └── test.volt
│ ├── 036
│ │ └── test.volt
│ ├── 037
│ │ └── test.volt
│ ├── 038
│ │ └── test.volt
│ ├── 039
│ │ └── test.volt
│ ├── 040
│ │ └── test.volt
│ ├── 041
│ │ └── test.volt
│ ├── 042
│ │ └── test.volt
│ ├── 043
│ │ └── test.volt
│ ├── 044
│ │ └── test.volt
│ ├── 045
│ │ └── test.volt
│ ├── 046
│ │ └── test.volt
│ ├── 047
│ │ └── test.volt
│ ├── 048
│ │ └── test.volt
│ ├── 049
│ │ └── test.volt
│ ├── 050
│ │ └── test.volt
│ ├── 051
│ │ └── test.volt
│ ├── 052
│ │ └── test.volt
│ ├── badAATypeParse
│ │ └── test.volt
│ ├── badAssignToSelfWarning
│ │ └── test.volt
│ ├── badTemplateDefinitionParamName
│ │ └── test.volt
│ ├── badTemplateInstance
│ │ └── test.volt
│ ├── deps
│ │ ├── m1.volt
│ │ └── m2.volt
│ ├── foreachArrayNoIndex
│ │ └── test.volt
│ ├── foreachRangeIndex
│ │ └── test.volt
│ ├── nestedAssignToSelf
│ │ └── test.volt
│ ├── returnInScope
│ │ └── test.volt
│ ├── scopeInScope
│ │ └── test.volt
│ └── unterminatedComposable
│ │ └── test.volt
│ ├── expression
│ ├── assignment
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ └── shiftAssigns
│ │ │ └── test.volt
│ ├── binop
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ └── 013
│ │ │ └── test.volt
│ ├── bitwise
│ │ └── 001
│ │ │ └── test.volt
│ ├── cast
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ └── delegateToPointer
│ │ │ └── test.volt
│ ├── compose
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── escapeBackslash
│ │ │ └── test.volt
│ │ ├── escapeBackslashDetection
│ │ │ └── test.volt
│ │ └── ternary
│ │ │ └── test.volt
│ ├── constants
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ └── 004
│ │ │ └── test.volt
│ ├── dereference
│ │ ├── 001
│ │ │ └── test.volt
│ │ └── 002
│ │ │ └── test.volt
│ ├── implicit-conversion
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── 015
│ │ │ └── test.volt
│ │ ├── 016
│ │ │ └── test.volt
│ │ ├── 017
│ │ │ └── test.volt
│ │ ├── 018
│ │ │ └── test.volt
│ │ ├── 019
│ │ │ └── test.volt
│ │ └── 020
│ │ │ └── test.volt
│ ├── literal
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── exponentLiterals
│ │ │ └── test.volt
│ │ ├── simpleRaw
│ │ │ └── test.volt
│ │ └── unionInit
│ │ │ └── test.volt
│ ├── operator
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ └── 006
│ │ │ └── test.volt
│ ├── postfix
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ └── tdefault
│ │ │ ├── nontype
│ │ │ └── test.volt
│ │ │ ├── simpleFailure
│ │ │ └── test.volt
│ │ │ └── simpleWorking
│ │ │ └── test.volt
│ ├── primitive
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ └── 008
│ │ │ └── test.volt
│ ├── traitsModifiers
│ │ ├── badTraitsModifier
│ │ │ └── test.volt
│ │ ├── baseOf
│ │ │ └── test.volt
│ │ ├── elementOf
│ │ │ └── test.volt
│ │ ├── elementOfConstArray
│ │ │ └── test.volt
│ │ ├── elementOfStaticArray
│ │ │ └── test.volt
│ │ ├── keyOf
│ │ │ └── test.volt
│ │ ├── nonMatchingType
│ │ │ └── test.volt
│ │ └── valueOf
│ ├── traitsWords
│ │ ├── checkArrayBase
│ │ │ └── test.volt
│ │ ├── failure
│ │ │ └── test.volt
│ │ ├── isArray
│ │ │ └── test.volt
│ │ ├── isBitsType
│ │ │ └── test.volt
│ │ ├── isConst
│ │ │ └── test.volt
│ │ ├── isImmutable
│ │ │ └── test.volt
│ │ ├── isScope
│ │ │ └── test.volt
│ │ └── staticArrayIsArray
│ │ │ └── test.volt
│ ├── type
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ └── 004
│ │ │ └── test.volt
│ ├── typeid
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ └── enumArrayBase
│ │ │ └── test.volt
│ ├── typeof
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ └── 009
│ │ │ └── test.volt
│ └── unary
│ │ ├── 001
│ │ └── test.volt
│ │ ├── 002
│ │ └── test.volt
│ │ ├── 003
│ │ └── test.volt
│ │ ├── 004
│ │ └── test.volt
│ │ ├── 005
│ │ └── test.volt
│ │ ├── 006
│ │ └── test.volt
│ │ ├── 007
│ │ └── test.volt
│ │ ├── 008
│ │ └── test.volt
│ │ ├── 009
│ │ └── test.volt
│ │ ├── 010
│ │ └── test.volt
│ │ ├── 011
│ │ └── test.volt
│ │ ├── 012
│ │ └── test.volt
│ │ └── 013
│ │ └── test.volt
│ ├── function
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ ├── 027
│ │ └── test.volt
│ ├── 028
│ │ └── test.volt
│ ├── 029
│ │ └── test.volt
│ ├── 030
│ │ └── test.volt
│ ├── 031
│ │ └── test.volt
│ ├── 032
│ │ └── test.volt
│ ├── 033
│ │ └── test.volt
│ ├── 034
│ │ └── test.volt
│ ├── 035
│ │ └── test.volt
│ ├── 036
│ │ └── test.volt
│ ├── 037
│ │ └── test.volt
│ ├── 038
│ │ └── test.volt
│ ├── 039
│ │ └── test.volt
│ ├── 040
│ │ └── test.volt
│ ├── 041
│ │ └── test.volt
│ ├── 042
│ │ └── test.volt
│ ├── 043
│ │ └── test.volt
│ ├── 044
│ │ └── test.volt
│ ├── 045
│ │ └── test.volt
│ ├── 046
│ │ └── test.volt
│ ├── 047
│ │ └── test.volt
│ ├── 048
│ │ └── test.volt
│ ├── 049
│ │ └── test.volt
│ ├── 050
│ │ └── test.volt
│ ├── 051
│ │ └── test.volt
│ ├── 052
│ │ └── test.volt
│ ├── 053
│ │ └── test.volt
│ ├── 054
│ │ └── test.volt
│ ├── 055
│ │ └── test.volt
│ ├── 056
│ │ └── test.volt
│ ├── 057
│ │ └── test.volt
│ ├── 058
│ │ └── test.volt
│ ├── 059
│ │ └── test.volt
│ └── 060
│ │ └── test.volt
│ ├── integer
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ └── 006
│ │ └── test.volt
│ ├── interface
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ └── deps
│ │ ├── iface.volt
│ │ └── impl.volt
│ ├── lexing
│ └── 001
│ │ └── test.volt
│ ├── lookup
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ └── 005
│ │ └── test.volt
│ ├── nested
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ └── 024
│ │ └── test.volt
│ ├── overloading
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ ├── 027
│ │ └── test.volt
│ ├── 028
│ │ └── test.volt
│ ├── 029
│ │ └── test.volt
│ ├── 030
│ │ └── test.volt
│ ├── 031
│ │ └── test.volt
│ ├── 032
│ │ └── test.volt
│ ├── 033
│ │ └── test.volt
│ ├── 034
│ │ └── test.volt
│ ├── 035
│ │ └── test.volt
│ ├── 036
│ │ └── test.volt
│ ├── 037
│ │ └── test.volt
│ ├── 038
│ │ └── test.volt
│ ├── 039
│ │ └── test.volt
│ ├── 040
│ │ └── test.volt
│ ├── 041
│ │ └── test.volt
│ ├── 042
│ │ └── test.volt
│ ├── 043
│ │ └── test.volt
│ ├── 044
│ │ └── test.volt
│ ├── 045
│ │ └── test.volt
│ ├── 046
│ │ └── test.volt
│ ├── 047
│ │ └── test.volt
│ ├── 048
│ │ └── test.volt
│ ├── 049
│ │ └── test.volt
│ ├── 050
│ │ └── test.volt
│ ├── 051
│ │ └── test.volt
│ ├── 052
│ │ └── test.volt
│ ├── 053
│ │ └── test.volt
│ ├── 054
│ │ └── test.volt
│ ├── 055
│ │ └── test.volt
│ └── 056
│ │ └── test.volt
│ ├── parsing
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ └── 007
│ │ └── test.volt
│ ├── protection
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ └── deps
│ │ ├── a.volt
│ │ ├── person.volt
│ │ └── usepriv.volt
│ ├── scope
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ └── 003
│ │ └── test.volt
│ ├── simple
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ └── 007
│ │ └── test.volt
│ ├── statement
│ ├── alias
│ │ ├── 001
│ │ │ └── test.volt
│ │ └── 002
│ │ │ └── test.volt
│ ├── assert
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ └── 004
│ │ │ └── test.volt
│ ├── catch
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ └── wineh
│ │ │ ├── finally
│ │ │ └── test.volt
│ │ │ ├── multipleTries
│ │ │ └── test.volt
│ │ │ ├── nestedGarbage
│ │ │ └── test.volt
│ │ │ ├── simple
│ │ │ └── test.volt
│ │ │ ├── simplePoly
│ │ │ └── test.volt
│ │ │ └── simpleReversedPoly
│ │ │ └── test.volt
│ ├── for
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ └── 004
│ │ │ └── test.volt
│ ├── foreach
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ └── 005
│ │ │ └── test.volt
│ ├── if
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ └── 003
│ │ │ └── test.volt
│ ├── import
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── 015
│ │ │ └── test.volt
│ │ ├── 016
│ │ │ └── test.volt
│ │ ├── 017
│ │ │ └── test.volt
│ │ ├── 018
│ │ │ └── test.volt
│ │ ├── 019
│ │ │ └── test.volt
│ │ ├── 020
│ │ │ └── test.volt
│ │ ├── 021
│ │ │ └── test.volt
│ │ ├── 022
│ │ │ └── test.volt
│ │ ├── 023
│ │ │ └── test.volt
│ │ ├── 024
│ │ │ └── test.volt
│ │ ├── 025
│ │ │ └── test.volt
│ │ ├── 026
│ │ │ └── test.volt
│ │ ├── 027
│ │ │ └── test.volt
│ │ ├── 028
│ │ │ └── test.volt
│ │ ├── 029
│ │ │ └── test.volt
│ │ ├── 030
│ │ │ └── test.volt
│ │ ├── 031
│ │ │ └── test.volt
│ │ ├── 032
│ │ │ └── test.volt
│ │ ├── 033
│ │ │ └── test.volt
│ │ ├── 034
│ │ │ └── test.volt
│ │ ├── 035
│ │ │ └── test.volt
│ │ ├── 036
│ │ │ └── test.volt
│ │ ├── 037
│ │ │ └── test.volt
│ │ ├── 038
│ │ │ └── test.volt
│ │ ├── 039
│ │ │ └── test.volt
│ │ ├── 040
│ │ │ └── test.volt
│ │ ├── 041
│ │ │ └── test.volt
│ │ ├── 042
│ │ │ └── test.volt
│ │ ├── 043
│ │ │ └── test.volt
│ │ ├── 044
│ │ │ └── test.volt
│ │ ├── 045
│ │ │ └── test.volt
│ │ ├── 046
│ │ │ └── test.volt
│ │ ├── 047
│ │ │ └── test.volt
│ │ ├── 048
│ │ │ └── test.volt
│ │ ├── 049
│ │ │ └── test.volt
│ │ ├── 050
│ │ │ └── test.volt
│ │ ├── 051
│ │ │ └── test.volt
│ │ ├── 052
│ │ │ └── test.volt
│ │ ├── 053
│ │ │ └── test.volt
│ │ ├── 054
│ │ │ └── test.volt
│ │ ├── README.txt
│ │ └── deps
│ │ │ ├── a.volt
│ │ │ ├── a36.volt
│ │ │ ├── add1.volt
│ │ │ ├── add2.volt
│ │ │ ├── b.volt
│ │ │ ├── b36.volt
│ │ │ ├── bug_031_m1.volt
│ │ │ ├── bug_031_m2.volt
│ │ │ ├── bug_031_m3.volt
│ │ │ ├── c.volt
│ │ │ ├── co
│ │ │ └── window.volt
│ │ │ ├── e.volt
│ │ │ ├── f.volt
│ │ │ ├── foo
│ │ │ └── bar
│ │ │ │ └── baz.volt
│ │ │ ├── g.volt
│ │ │ ├── h.volt
│ │ │ ├── i.volt
│ │ │ ├── m1.volt
│ │ │ ├── m12.volt
│ │ │ ├── m13.volt
│ │ │ ├── m14.volt
│ │ │ ├── m2.volt
│ │ │ ├── m3.volt
│ │ │ ├── m4.volt
│ │ │ ├── m5.volt
│ │ │ ├── m6.volt
│ │ │ ├── m7.volt
│ │ │ ├── m8.volt
│ │ │ ├── m9.volt
│ │ │ ├── mod1.volt
│ │ │ ├── mod2.volt
│ │ │ ├── mod3.volt
│ │ │ ├── nine53.volt
│ │ │ ├── person53.volt
│ │ │ └── test2.volt
│ ├── staticIf
│ │ ├── mutableIndirection
│ │ │ └── test.volt
│ │ ├── nonBoolCondition
│ │ │ └── test.volt
│ │ ├── simple
│ │ │ └── test.volt
│ │ ├── simpleMainBlock
│ │ │ └── test.volt
│ │ └── simpleNoElse
│ │ │ └── test.volt
│ ├── switch
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ ├── 004
│ │ │ └── test.volt
│ │ ├── 005
│ │ │ └── test.volt
│ │ ├── 006
│ │ │ └── test.volt
│ │ ├── 007
│ │ │ └── test.volt
│ │ ├── 008
│ │ │ └── test.volt
│ │ ├── 009
│ │ │ └── test.volt
│ │ ├── 010
│ │ │ └── test.volt
│ │ ├── 011
│ │ │ └── test.volt
│ │ ├── 012
│ │ │ └── test.volt
│ │ ├── 013
│ │ │ └── test.volt
│ │ ├── 014
│ │ │ └── test.volt
│ │ ├── 015
│ │ │ └── test.volt
│ │ ├── 016
│ │ │ └── test.volt
│ │ ├── 017
│ │ │ └── test.volt
│ │ ├── 018
│ │ │ └── test.volt
│ │ ├── 019
│ │ │ └── test.volt
│ │ ├── 020
│ │ │ └── test.volt
│ │ ├── 021
│ │ │ └── test.volt
│ │ ├── 022
│ │ │ └── test.volt
│ │ ├── 023
│ │ │ └── test.volt
│ │ ├── 024
│ │ │ └── test.volt
│ │ ├── 025
│ │ │ └── test.volt
│ │ ├── 026
│ │ │ └── test.volt
│ │ ├── 027
│ │ │ └── test.volt
│ │ ├── 028
│ │ │ └── test.volt
│ │ ├── 029
│ │ │ └── test.volt
│ │ ├── 030
│ │ │ └── test.volt
│ │ ├── 031
│ │ │ └── test.volt
│ │ ├── 032
│ │ │ └── test.volt
│ │ ├── gotoCaseStringNoExp
│ │ │ └── test.volt
│ │ ├── stringEnumCase
│ │ │ └── test.volt
│ │ └── stringSwitchBadCase
│ │ │ └── test.volt
│ ├── while
│ │ └── 001
│ │ │ └── test.volt
│ └── with
│ │ ├── 001
│ │ └── test.volt
│ │ ├── 002
│ │ └── test.volt
│ │ ├── 003
│ │ └── test.volt
│ │ ├── 004
│ │ └── test.volt
│ │ └── 005
│ │ └── test.volt
│ ├── template
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ ├── 013
│ │ └── test.volt
│ ├── 014
│ │ └── test.volt
│ ├── 015
│ │ └── test.volt
│ ├── 016
│ │ └── test.volt
│ ├── 017
│ │ └── test.volt
│ ├── 018
│ │ └── test.volt
│ ├── 019
│ │ └── test.volt
│ ├── 020
│ │ └── test.volt
│ ├── 021
│ │ └── test.volt
│ ├── 022
│ │ └── test.volt
│ ├── 023
│ │ └── test.volt
│ ├── 024
│ │ └── test.volt
│ ├── 025
│ │ └── test.volt
│ ├── 026
│ │ └── test.volt
│ ├── 027
│ │ └── test.volt
│ ├── 028
│ │ └── test.volt
│ ├── 029
│ │ └── test.volt
│ ├── 030
│ │ └── test.volt
│ ├── 031
│ │ └── test.volt
│ ├── 032
│ │ └── test.volt
│ ├── 033
│ │ └── test.volt
│ ├── 034
│ │ └── test.volt
│ ├── 035
│ │ └── test.volt
│ ├── 036
│ │ └── test.volt
│ ├── 037
│ │ └── test.volt
│ ├── 038
│ │ └── test.volt
│ ├── 039
│ │ └── test.volt
│ ├── 040
│ │ └── test.volt
│ ├── 041
│ │ └── test.volt
│ ├── 042
│ │ └── test.volt
│ ├── 043
│ │ └── test.volt
│ ├── 044
│ │ └── test.volt
│ ├── 045
│ │ └── test.volt
│ ├── 046
│ │ └── test.volt
│ ├── 047
│ │ └── test.volt
│ ├── 048
│ │ └── test.volt
│ ├── 049
│ │ └── test.volt
│ ├── 050
│ │ └── test.volt
│ ├── 051
│ │ └── test.volt
│ ├── 052
│ │ └── test.volt
│ ├── 053
│ │ └── test.volt
│ ├── 054
│ │ └── test.volt
│ ├── 055
│ │ └── test.volt
│ ├── 056
│ │ └── test.volt
│ ├── 057
│ │ └── test.volt
│ ├── 058
│ │ └── test.volt
│ ├── 059
│ │ └── test.volt
│ ├── 060
│ │ └── test.volt
│ ├── 061
│ │ └── test.volt
│ ├── 062
│ │ └── test.volt
│ ├── 063
│ │ └── test.volt
│ ├── 064
│ │ └── test.volt
│ ├── 065
│ │ └── test.volt
│ ├── 066
│ │ └── test.volt
│ ├── 067
│ │ └── test.volt
│ ├── 068
│ │ └── test.volt
│ ├── 069
│ │ └── test.volt
│ ├── abstractClassTemplate
│ │ └── test.volt
│ ├── abstractClassTemplateFail
│ │ └── test.volt
│ ├── classMixin
│ │ └── test.volt
│ ├── complexInterface
│ │ └── test.volt
│ ├── deps
│ │ ├── add.volt
│ │ ├── allocmap.volt
│ │ ├── contrived.volt
│ │ ├── eyeballs.volt
│ │ ├── get.volt
│ │ ├── person.volt
│ │ ├── storetest.volt
│ │ └── vec.volt
│ ├── externCTemplateFunction
│ │ └── test.volt
│ ├── functionTemplateArgument
│ │ └── test.volt
│ ├── functionValue
│ │ └── test.volt
│ ├── inheritFromTemplate
│ │ └── test.volt
│ ├── nestedReservedShadow
│ │ └── test.volt
│ ├── nestedTemplateFunction
│ │ └── test.volt
│ ├── overloading
│ │ └── test.volt
│ ├── overloadingAlias
│ │ └── test.volt
│ ├── overloadingFailure
│ │ └── test.volt
│ ├── parsing
│ │ └── storage
│ │ │ └── test.volt
│ ├── res
│ │ └── empty.txt
│ ├── selfReference
│ │ └── test.volt
│ ├── simpleClass
│ │ └── test.volt
│ ├── simpleFunctionNoMixin
│ │ └── test.volt
│ ├── simpleInterface
│ │ └── test.volt
│ ├── simpleMixinFailure
│ │ └── test.volt
│ ├── simpleMixinFunctionFailure
│ │ └── test.volt
│ ├── simpleNonMixin
│ │ └── test.volt
│ ├── simpleStandaloneFunction
│ │ └── test.volt
│ ├── simpleUnion
│ │ └── test.volt
│ ├── structConstructorInMethod
│ │ └── test.volt
│ ├── structStaticFunctionFail
│ │ └── test.volt.dis
│ ├── templateInheritsFromNonTemplate
│ │ └── test.volt
│ ├── templateInheritsFromTemplate
│ │ └── test.volt
│ ├── unionMixin
│ │ └── test.volt
│ └── variableAccess
│ │ └── test.volt
│ ├── testing
│ └── 001
│ │ └── test.volt
│ ├── toplevel
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── deps
│ │ └── clazz.volt
│ └── shortEnum
│ │ └── test.volt
│ ├── type
│ ├── asi
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── 003
│ │ │ └── test.volt
│ │ └── 004
│ │ │ └── test.volt
│ ├── class
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ └── 003
│ │ │ └── test.volt
│ ├── delegate
│ │ └── 001
│ │ │ └── test.volt
│ ├── storage
│ │ ├── 001
│ │ │ └── test.volt
│ │ ├── 002
│ │ │ └── test.volt
│ │ ├── refConstNestedStructModification
│ │ │ └── test.volt
│ │ ├── refConstPointer
│ │ │ └── test.volt
│ │ ├── refConstStructModification
│ │ │ └── test.volt
│ │ ├── refConstStructModifiedThroughMember
│ │ │ └── test.volt.dis
│ │ ├── refConstStructUnaryDecrement
│ │ │ └── test.volt
│ │ ├── refConstSuperNested
│ │ │ └── test.volt
│ │ ├── refInStructDecrement
│ │ │ └── test.volt
│ │ ├── refInStructIncrement
│ │ │ └── test.volt
│ │ ├── refInStructModification
│ │ │ └── test.volt
│ │ ├── refInStructPlusAssign
│ │ │ └── test.volt
│ │ └── refInStructUnaryIncrement
│ │ │ └── test.volt
│ └── string
│ │ └── 001
│ │ └── test.volt
│ └── vrt
│ ├── eh
│ └── 001
│ │ └── test.volt
│ ├── errno
│ └── libcBadCallSetsErrno
│ │ └── test.volt
│ ├── format
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ └── 006
│ │ └── test.volt
│ ├── gc
│ ├── 001
│ │ └── test.volt
│ ├── 002
│ │ └── test.volt
│ ├── 003
│ │ └── test.volt
│ ├── 004
│ │ └── test.volt
│ ├── 005
│ │ └── test.volt
│ ├── 006
│ │ └── test.volt
│ ├── 007
│ │ └── test.volt
│ ├── 008
│ │ └── test.volt
│ ├── 009
│ │ └── test.volt
│ ├── 010
│ │ └── test.volt
│ ├── 011
│ │ └── test.volt
│ ├── 012
│ │ └── test.volt
│ └── 013
│ │ └── test.volt
│ └── thread
│ ├── delegateShouldSeeState
│ └── test.volt
│ ├── globalConstructorsShouldOnlyRunOnce
│ └── test.volt
│ ├── localConstructorsRunEachThread
│ └── test.volt
│ ├── localDestructorsRunOnJoin
│ └── test.volt
│ ├── multipleThreadsLocalData
│ └── test.volt
│ ├── simpleMutex
│ └── test.volt
│ ├── sleep
│ └── test.volt
│ └── verifyThreadsRunParallel
│ └── test.volt
├── sources.mk
└── src
├── lib
└── llvm
│ ├── analysis.d
│ ├── bitreader.d
│ ├── bitwriter.d
│ ├── c
│ ├── Analysis.d
│ ├── BitReader.d
│ ├── BitWriter.d
│ ├── Core.d
│ ├── DebugInfo.d
│ ├── ExecutionEngine.d
│ ├── Initialization.d
│ ├── Linker.d
│ ├── Support.d
│ ├── Target.d
│ └── TargetMachine.d
│ ├── core.d
│ ├── executionengine.d
│ ├── support.d
│ └── targetmachine.d
├── main.d
└── volt
├── arg.d
├── driver.d
├── errors.d
├── exceptions.d
├── interfaces.d
├── ir
└── lifter.d
├── llvm
├── abi
│ ├── base.d
│ ├── sysvamd64.d
│ └── winamd64.d
├── backend.d
├── common.d
├── constant.d
├── debugInfo.d
├── driver.d
├── dwarf.d
├── expression.d
├── host.d
├── interfaces.d
├── intrinsicVersion.d
├── state.d
├── toplevel.d
└── type.d
├── lowerer
├── alloc.d
├── array.d
├── callBuilder.d
├── image.d
├── llvmlowerer.d
├── manglewriter.d
├── newreplacer.d
└── typeidreplacer.d
├── semantic
├── cfg.d
├── classify.d
├── classresolver.d
├── context.d
├── evaluate.d
├── extyper.d
├── folder.d
├── implicit.d
├── irverifier.d
├── languagepass.d
├── lifter.d
├── lookup.d
├── mangle.d
├── nested.d
├── overload.d
├── templatelifter.d
├── typeinfo.d
├── typer.d
└── util.d
├── util
├── cmdgroup.d
├── dup.d
├── mangledecoder.d
├── path.d
├── perf.d
└── worktracker.d
└── visitor
├── debugprinter.d
├── jsonprinter.d
├── nodereplace.d
└── prettyprinter.d
/Jenkinsfile:
--------------------------------------------------------------------------------
1 | library('volt-build')
2 |
3 | voltBuildVolta()
4 |
--------------------------------------------------------------------------------
/doc/.gitignore:
--------------------------------------------------------------------------------
1 | html
2 |
--------------------------------------------------------------------------------
/doc/_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "Volta Documentation Page",
3 | "vdoc": {
4 | "name": "Volta"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/doc/_includes/content.md:
--------------------------------------------------------------------------------
1 | {%- assign obj = include.obj %}
2 |
3 | ## {{ obj.name }}
4 |
5 |
6 | {{ obj | vdoc_content: 'md' }}
7 |
--------------------------------------------------------------------------------
/dsupport/battery.toml:
--------------------------------------------------------------------------------
1 | #
2 | # Dummy file
3 | #
4 | # This is a slight hack for dmd building. Dmd will pickup the D files in this
5 | # folder. But volta will not, since we do not use the --scan-for-d flag.
6 | #
7 | name = "volta.dsupport"
8 |
--------------------------------------------------------------------------------
/dsupport/src/core/c/time.d:
--------------------------------------------------------------------------------
1 | module core.c.time;
2 | public import core.stdc.time;
3 |
--------------------------------------------------------------------------------
/dsupport/src/volta_dsupport_dummy.volt:
--------------------------------------------------------------------------------
1 | module volta_dsupport_dummy;
2 |
--------------------------------------------------------------------------------
/dsupport/src/watt/algorithm.d:
--------------------------------------------------------------------------------
1 | module watt.algorithm;
2 |
3 | static import std.algorithm;
4 |
5 | alias cmpfn = bool function(object.Object, object.Object);
6 |
7 | void sort(object.Object[] objects, cmpfn cmp)
8 | {
9 | std.algorithm.sort!cmp(objects);
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/dsupport/src/watt/io/std.d:
--------------------------------------------------------------------------------
1 | module watt.io.std;
2 |
3 | public:
4 | import std.stdio : writef, writefln;
5 | import undead.cstream : output = dout;
6 | import undead.cstream : error = derr;
7 |
--------------------------------------------------------------------------------
/dsupport/src/watt/io/streams.d:
--------------------------------------------------------------------------------
1 | module watt.io.streams;
2 |
3 | public import undead.stream : OutputStream, BufferedFile, FileMode;
4 |
5 | class OutputFileStream : BufferedFile
6 | {
7 | this(string filename)
8 | {
9 | super(filename, FileMode.OutNew);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/dsupport/src/watt/text/ascii.d:
--------------------------------------------------------------------------------
1 | module watt.text.ascii;
2 |
3 | public import std.uni : isWhite, isAlpha;
4 | public import std.ascii : isDigit;
5 |
--------------------------------------------------------------------------------
/dsupport/src/watt/text/format.d:
--------------------------------------------------------------------------------
1 | module watt.text.format;
2 |
3 | public import std.string : format;
4 |
--------------------------------------------------------------------------------
/dsupport/src/watt/text/string.d:
--------------------------------------------------------------------------------
1 | module watt.text.string;
2 |
3 | public:
4 | import std.algorithm : startsWith, endsWith;
5 | import std.string : indexOf, strip, split, splitLines;
6 | import std.array : replace;
7 |
--------------------------------------------------------------------------------
/lib/battery.toml:
--------------------------------------------------------------------------------
1 | #
2 | # We have D files tell it to scan for them
3 | #
4 | name = "volta.lib"
5 | scanForD = true
6 | #
7 | # We need watt to build
8 | #
9 | dependencies = ["watt"]
10 |
--------------------------------------------------------------------------------
/lib/src/volta/visitor/package.d:
--------------------------------------------------------------------------------
1 | /*#D*/
2 | // Copyright 2012-2017, Jakob Bornecrantz.
3 | // SPDX-License-Identifier: BSL-1.0
4 | module volta.visitor;
5 |
6 | public import volta.visitor.visitor;
7 |
--------------------------------------------------------------------------------
/rt/src/core/c/posix/sys/wait.volt:
--------------------------------------------------------------------------------
1 | module core.c.posix.sys.wait;
2 |
3 | version (Posix):
4 | extern (C):
5 |
6 | fn WEXITSTATUS(rv: i32) i32
7 | {
8 | return (rv >> 8) & 0xFF;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/src/vrt/os/eh/common.volt:
--------------------------------------------------------------------------------
1 | // Copyright 2013-2018, Jakob Bornecrantz.
2 | // SPDX-License-Identifier: BSL-1.0
3 | module vrt.os.eh.common;
4 |
5 | /*!
6 | * Exception class, used to identify for other handlers.
7 | */
8 | global VRT_EH_NAME: string = "VOLT___\0";
9 |
--------------------------------------------------------------------------------
/rt/test/aa/001/test.volt:
--------------------------------------------------------------------------------
1 | // Basic AA test.
2 | module test;
3 |
4 | int main()
5 | {
6 | aa: i32[i32];
7 | aa[3] = 42;
8 | return aa[3] == 42 ? 0 : 1;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/aa/002/test.volt:
--------------------------------------------------------------------------------
1 | // Basic AA test.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa: i32[string];
7 | key := "volt";
8 | aa[key] = 42;
9 | return aa["volt"] == 42 ? 0 : 1;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aa/003/test.volt:
--------------------------------------------------------------------------------
1 | // Basic AA test.
2 | module test;
3 |
4 | struct Test {
5 | aa: i32[string];
6 | }
7 |
8 | int main()
9 | {
10 | test: Test;
11 | test.aa["volt"] = 42;
12 | key := "volt";
13 | return test.aa[key] == 42 ? 0 : 1;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/aa/004/test.volt:
--------------------------------------------------------------------------------
1 | // Basic AA test, forwarding ops to value.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa: i32[string];
7 | key := "volt";
8 | aa["volt"] = 20;
9 | aa[key] += 1;
10 | aa["volt"] *= 2;
11 | return aa[key] == 42 ? 0 : 1;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/aa/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Invalid key type accessing aa.
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | aa: i32[i32];
8 | return aa["volt"];
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/rt/test/aa/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Assigning to invalid value type.
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | aa: i32[i32];
8 | x: string = aa["volt"];
9 | return 1;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aa/008/test.volt:
--------------------------------------------------------------------------------
1 | // Test AA initialisers.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa := [3:42];
7 | return aa[3] == 42 ? 0 : 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/aa/009/test.volt:
--------------------------------------------------------------------------------
1 | // More AA initialiser tests.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | result: i32 = 42;
7 | aa := [3:result];
8 | return aa[3] == 42 ? 0 : 1;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/aa/010/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test that assigning null to AAs is an error.
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | result: i32 = 42;
8 | aa := [3:result];
9 | aa := null;
10 | return aa[3];
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/aa/011/test.volt:
--------------------------------------------------------------------------------
1 | //T requires:exceptions
2 | // Reset AAs.
3 | module test;
4 |
5 | import core.exception : Throwable;
6 |
7 | int main()
8 | {
9 | aa := [3:42];
10 | aa = [:];
11 | try {
12 | return aa[3];
13 | } catch (Throwable) {
14 | return 0;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/aa/012/test.volt:
--------------------------------------------------------------------------------
1 | // AA test.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | foo: i32[string];
7 | foo["aaa"] = 1;
8 | foo["bbbb"] = 2;
9 |
10 | f := foo.keys;
11 |
12 | return cast(i32)(f[0].length + f[1].length) == 7 ? 0 : 1;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/aa/015/test.volt:
--------------------------------------------------------------------------------
1 | // AA get method, remove.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa: i32[string];
7 | aa["hello"] = 35;
8 | aa.remove("hello");
9 | return aa.get("hello", 31) == 31 ? 0 : 1;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aa/016/test.volt:
--------------------------------------------------------------------------------
1 | // AA dup.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa1: string[string];
7 | aa1["hello"] = "hi";
8 | aa2 := new aa1[..];
9 | aa2["hello"] = "hel";
10 | return aa1["hello"] == "hi" ? 0 : 1;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/aa/017/test.volt:
--------------------------------------------------------------------------------
1 | // AA as lvalue.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa: i32[string];
7 | return aa["volt"] = 0;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/aa/018/test.volt:
--------------------------------------------------------------------------------
1 | // AA literals.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa: string[string] = ["volt":"rox"];
7 | return aa["volt"].length == 3 ? 0 : 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/aa/019/test.volt:
--------------------------------------------------------------------------------
1 | // Consecutive AA declarations.
2 | module test;
3 |
4 | int main()
5 | {
6 | aa: i32[string];
7 | bb: i32[string];
8 | aa["hello"] = 42;
9 | return aa.length + bb.length == 1 ? 0 : 1;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aa/020/test.volt:
--------------------------------------------------------------------------------
1 | // Large numbers and AAs.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | aa: u64[u64];
7 | aa[u64.max] = u64.max;
8 | aa = new aa[..];
9 | return aa[u64.max] > u32.max ? 0 : 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aa/021/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | obj := new object.Object();
7 | aa: i32[object.Object];
8 | aa[obj] = 12;
9 | return aa[obj];
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aa/023/test.volt:
--------------------------------------------------------------------------------
1 | // Directly indexing AA expressions.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | a: i32[] = [1, 2, 3];
7 | aa: i32[][string];
8 | aa["hello"] = a;
9 | return aa["hello"][1] == 2 ? 0 : 1;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aa/024/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:do-not-link
2 | module test;
3 |
4 | struct StringHolder
5 | {
6 | a: i32;
7 | }
8 |
9 | fn main() i32
10 | {
11 | sh: StringHolder;
12 | sh.a = 15;
13 | a: i32[StringHolder];
14 | a[sh] = 12;
15 | a.remove(sh);
16 | return a[sh];
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/rt/test/aa/025/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | struct Struct
5 | {
6 | a: i32[];
7 | }
8 |
9 | fn main(args: string[]) i32
10 | {
11 | aa: i32[Struct];
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/aa/027/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | global tests := [
4 | "a": "isProperty",
5 | ];
6 |
7 | fn main(args: string[]) i32
8 | {
9 | assert(tests["a"] == "isProperty");
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/aa/enumAsKey/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | enum E
4 | {
5 | A, B, C
6 | }
7 |
8 | fn main() i32
9 | {
10 | aa: i32[E];
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:define i32 @ADD_TWO_INTEGERS(i32, i32) #0 {
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | extern (C) fn ADD_TWO_INTEGERS(a: i32, b: i32) i32
7 | {
8 | return a + b;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:define i32 @byVal(i64) #0 {
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct Colour
7 | {
8 | a, b: i32;
9 | }
10 |
11 | extern (C) fn byVal(c: Colour) i32
12 | {
13 | return c.b;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:define i8 @byVal(i32) #0 {
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct Colour
7 | {
8 | r, g, b, a: u8;
9 | }
10 |
11 | extern (C) fn byVal(c: Colour) u8
12 | {
13 | return c.b;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:define i8 @byVal(%S4test6Colour* byval) #0 {
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct Colour
7 | {
8 | buf: u8[256];
9 | }
10 |
11 | extern (C) fn byVal(c: Colour) u8
12 | {
13 | return c.buf[128];
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:define float @ADD_TWO_FLOATS(float, float) #0 {
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | extern (C) fn ADD_TWO_FLOATS(a: f32, b: f32) f32
7 | {
8 | return a + b;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:define float @byVal(<2 x float>) #0 {
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct Colour
7 | {
8 | a, b: f32;
9 | }
10 |
11 | extern (C) fn byVal(c: Colour) f32
12 | {
13 | return c.b;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:define i8 @byVal(i64, i40) #0 {
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct Colour
7 | {
8 | a,b,c,d, e,f,g,h, i,j,k,l, m: u8;
9 | }
10 |
11 | extern (C) fn byVal(c: Colour) u8
12 | {
13 | return c.b;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/012/test.volt:
--------------------------------------------------------------------------------
1 | //T requires:sysvamd64
2 | module test;
3 |
4 | extern (C) fn SumVoltIntegerArray(array: i32[]) i32
5 | {
6 | sum: i32;
7 | sum = cast(i32)array.length;
8 | return sum;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return SumVoltIntegerArray(null);
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/015/test.volt:
--------------------------------------------------------------------------------
1 | //T requires:sysvamd64
2 | module test;
3 |
4 | extern (C) fn func(a: string, b: string) i32
5 | {
6 | return cast(i32)a.length + cast(i32)b.length;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return func("ab", "cde") - 5;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/017/test.volt:
--------------------------------------------------------------------------------
1 | //T requires:sysvamd64
2 | module test;
3 |
4 | extern (C) fn decode_u8_d(str: string) i32
5 | {
6 | return cast(i32)str.length;
7 | }
8 |
9 | fn main() i32
10 | {
11 | str := "hello";
12 | return decode_u8_d(str) - 5;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/019/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare void @func(i32, i32)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | a: i32;
9 | }
10 |
11 | extern (C) fn func(a: i32, b: S0);
12 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/020/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare i8* @func(i64, i8*)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | x: i64;
9 | ptr: char*;
10 | }
11 |
12 | extern (C) fn func(s: S0) char*;
13 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/021/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare void @func(i32, i64, i32)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | a: i16;
9 | b: u32;
10 | c: i32;
11 | }
12 |
13 | extern (C) fn func(a: i32, s: S0);
14 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/022/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare void @func(<2 x float>, <2 x float>)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | a, b, c, d: f32;
9 | }
10 |
11 | extern (C) fn func(a: S0);
12 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/023/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare void @func(double, i32)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | a: f64;
9 | b: i32;
10 | }
11 |
12 | extern (C) fn func(a: S0);
13 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/024/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare void @func(double, i32)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | struct S1 {
9 | a: f64;
10 | b: i32;
11 | }
12 | x: S1[1];
13 | }
14 |
15 | extern (C) fn func(a: S0);
16 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/025/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare void @func(i64, i24)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | a: u8[8];
9 | b: u8;
10 | c: u8;
11 | d: u8;
12 | }
13 |
14 | extern (C) fn func(a: S0);
15 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64sysv/026/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T check:declare float @func(<2 x float>, float)
3 | //T requires:sysvamd64
4 | module test;
5 |
6 | struct S0
7 | {
8 | a, b, c: f32;
9 | }
10 |
11 | extern (C) fn func(a: S0) f32;
12 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64win/001/abitest.c:
--------------------------------------------------------------------------------
1 | // win64abi sanity test
2 |
3 | #include
4 |
5 | int32_t getZero()
6 | {
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/abi/amd64win/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:win64abi
2 | //T requires:win64
3 | //T check:@getZero()
4 | // win64abi sanity test
5 | module test;
6 |
7 | extern (C) fn getZero() i32;
8 |
9 | fn main() i32
10 | {
11 | return getZero();
12 | }
--------------------------------------------------------------------------------
/rt/test/abi/amd64win/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:abi
2 | //T requires:win64
3 | //T check:i32 @foo(%ac*)
4 | module test;
5 |
6 | extern (C) fn foo(str: string) i32
7 | {
8 | return cast(i32)str.length;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return foo("");
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/abi/ia32lin/001/abitest.c:
--------------------------------------------------------------------------------
1 | // struct return sanity test
2 |
3 | #include
4 |
5 | typedef struct
6 | {
7 | int32_t x;
8 | } S;
9 |
10 | S getTwelve()
11 | {
12 | S s;
13 | s.x = 12;
14 | return s;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/rt/test/aggregate/001/test.volt:
--------------------------------------------------------------------------------
1 | // Basic struct read test.
2 | module test;
3 |
4 |
5 | struct Test
6 | {
7 | val: i32;
8 | }
9 |
10 | fn main() i32
11 | {
12 | test: Test;
13 | return test.val;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/aggregate/002/test.volt:
--------------------------------------------------------------------------------
1 | // Basic struct write test.
2 | module test;
3 |
4 |
5 | struct Test
6 | {
7 | val: i32;
8 | }
9 |
10 | fn main() i32
11 | {
12 | test: Test;;
13 | test.val = 42;
14 | return test.val - 42;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/aggregate/005/test.volt:
--------------------------------------------------------------------------------
1 | // Local/global variables in structs.
2 | module test;
3 |
4 |
5 | struct Test
6 | {
7 | val: i32;
8 | local localVal: i32;
9 | }
10 |
11 | fn main() i32
12 | {
13 | Test.localVal = 42;
14 | return Test.localVal - 42;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/aggregate/007/test.volt:
--------------------------------------------------------------------------------
1 | // Struct literals.
2 | module test;
3 |
4 |
5 | struct Point
6 | {
7 | x: i16;
8 | y: i32;
9 | }
10 |
11 | fn main() i32
12 | {
13 | p: Point = {1, 2};
14 | return p.x + p.y - 3;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/aggregate/019/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | enum
5 | {
6 | a,
7 | b = 7,
8 | c,
9 | }
10 |
11 | enum d = 5;
12 |
13 | fn main() i32
14 | {
15 | return a + b + c + d - 20;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/aggregate/021/test.volt:
--------------------------------------------------------------------------------
1 | // Test that enums can be implicitly casted to their base.
2 | module test;
3 |
4 |
5 | enum named { a, b, c, }
6 |
7 | fn main() i32
8 | {
9 | return named.a;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aggregate/022/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test that named enums can not be explicitly typed.
3 | module test;
4 |
5 |
6 | enum named { a: i32; }
7 |
8 | fn main() i32
9 | {
10 | return named.a;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/aggregate/025/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:may not be instantiated
3 | // Creation of abstraction classes.
4 | module test;
5 |
6 |
7 | abstract class Foo
8 | {
9 | }
10 |
11 | fn main() i32
12 | {
13 | foo := new Foo();
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/aggregate/026/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:may not have an implementation
3 | module test;
4 |
5 |
6 | class Foo
7 | {
8 | abstract fn x() i32 { return 3; }
9 | }
10 |
11 | fn main() i32
12 | {
13 | foo := new Foo();
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/aggregate/027/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:may not have an implementation
3 | module test;
4 |
5 |
6 | abstract class Foo
7 | {
8 | abstract fn x() i32 { return 3; }
9 | }
10 |
11 | class Bar : Foo {}
12 |
13 | fn main() i32
14 | {
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/aggregate/031/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:attempted to assign to
3 | module test;
4 |
5 | struct S
6 | {
7 | x: i32 = 3;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return 0;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/aggregate/032/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:const or immutable non local/global field
3 | module test;
4 |
5 | struct S
6 | {
7 | x: const(i32);
8 | }
9 |
10 | fn main() i32
11 | {
12 | return 1;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/aggregate/038/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | class Foo
5 | {
6 | }
7 |
8 | fn main() i32
9 | {
10 | f := new Foo();
11 |
12 | // Should be able to call implicit constructors.
13 | f.__ctor();
14 |
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/aggregate/040/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct Point2D
4 | {
5 | x: f32;
6 | y: f32;
7 | a, b: i32;
8 | }
9 |
10 | fn main() i32
11 | {
12 | p: Point2D;
13 | p.x = 3.2f;
14 | p.b = cast(i32)p.x;
15 | return p.b - 3;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/aggregate/042/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:structs or unions may not define default constructors
3 | module test;
4 |
5 | struct Struct
6 | {
7 | this()
8 | {
9 | }
10 | }
11 |
12 | fn main() i32
13 | {
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/aggregate/043/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:structs or unions may not define a destructor
3 | module test;
4 |
5 | struct Struct
6 | {
7 | ~this()
8 | {
9 | }
10 | }
11 |
12 | fn main() i32
13 | {
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/aggregate/046/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | union u
4 | {
5 | a: u32;
6 | b: u32;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return cast(i32)typeid(u).size - 4;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/aggregate/048/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import theclass;
5 |
6 | fn main() i32
7 | {
8 | c := Class.basic();
9 | return c.field - 3;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/aggregate/049/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import theclass;
6 |
7 | fn main() i32
8 | {
9 | c := new Class();
10 | return c.field - 3;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/arrays/002/test.volt:
--------------------------------------------------------------------------------
1 | // Test string literals.
2 | module test;
3 |
4 |
5 | fn func(val: i32[]) i32
6 | {
7 | return val[1];
8 | }
9 |
10 | fn main() i32
11 | {
12 | return (func([41, 42, 43]) == 42) ? 0 : 1;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/arrays/003/test.volt:
--------------------------------------------------------------------------------
1 | // Test slicing.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | str: char[] = new char[](6);
8 | otherStr: char[] = str[0 .. 4];
9 |
10 | return (cast(int)otherStr.length == 4) ? 0 : 1;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/arrays/006/test.volt:
--------------------------------------------------------------------------------
1 | //Simple static array test.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | arg: i32[4];
8 | arg[0] = 42;
9 |
10 | return (arg[0] == 42) ? 0 : 1;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/arrays/015/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test appending to an array, expected to fail.
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | s: i16[];
9 | i: i32 = 3;
10 | s = s ~ i;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/016/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test appending to an array, expected to fail.
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | s: f32[];
9 | i: f64 = 3.0;
10 | s = s ~ i;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/017/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test appending to an array, expected to fail.
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | s: u32[];
9 | i: i32 = 3;
10 | s = s ~ i;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/018/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test appending to an array, expected to fail.
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | s: i16[];
9 | i: i32 = 3;
10 | s ~= i;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/019/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test appending to an array, expected to fail.
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | s: f32[];
9 | i: f64 = 3.0;
10 | s ~= i;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/020/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Test appending to an array, expected to fail.
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | s: u32[];
9 | i: i32 = 3;
10 | s ~= i;
11 | return 0;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/arrays/023/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := [1, 2, 3];
6 | b := new a[..];
7 | a[1] = 30;
8 | return (b[0] + b[1] + b[2] == 6) ? 0 : 1;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/rt/test/arrays/026/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Invalid array allocation.
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | a: i32[];
8 | // array concatenation, only arrays allowed.
9 | b: i32[] = new i32[](a, 3);
10 |
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/027/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Invalid array allocation.
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | a: i32[];
8 | // array allocation, no concatenation (array) allowed.
9 | b: i32[] = new i32[](3, a);
10 |
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/028/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Invalid allocation with new auto.
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | x: i32[] = new auto(3);
8 |
9 | return 1;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/arrays/030/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | s := ["hello", null];
6 | ss: string[2] = ["world", null];
7 | sss := [["what", null]];
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/arrays/032/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | aa := new char[](1);
6 | aa[0] = 'a';
7 | bb := new char[](1);
8 | bb[0] = 'a';
9 | a := [aa];
10 | b := [bb];
11 | if (a != b) {
12 | return 1;
13 | }
14 | return 0;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/rt/test/arrays/033/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | foo: i32[] = new i32[](4);
7 | f := cast(void[])foo;
8 | return (cast(i32) f.length == 16) ? 0 : 1; // 4 * 4 = 16
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/arrays/034/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | foo: i32[4];
7 | f := cast(void[])foo;
8 | return (cast(i32) f.length == 16) ? 0 : 1; // 4 * 4 = 16
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/arrays/035/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | elements: i32[4];
7 | foreach (i, ref e; elements) {
8 | e = 42;
9 | }
10 |
11 | return (elements[3] == 42) ? 0 : 1;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/arrays/036/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | sarr: i32[4];
7 | // Make sure that arr refer to sarr's storage
8 | arr: i32[] = sarr;
9 |
10 | arr[3] = 42;
11 |
12 | return (sarr[3] == 42) ? 0 : 1;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/arrays/037/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a: i32[][] = [[1, 2, 3]];
6 | b: i32[][] = [[0, 0, 0]];
7 | b[0] = new a[0][0 .. $];
8 | return (b[0][1] == 2) ? 0 : 1;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/arrays/038/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := [1, 2, 3];
6 | b := new a[0 .. $-1];
7 | return (b[$-1] == 2) ? 0 : 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/arrays/039/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := [1, 2, 3];
6 | b := a[..];
7 | return (b[$-1] == 3) ? 0 : 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/arrays/040/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct A
4 | {
5 | a: i32[];
6 | }
7 |
8 | fn main() i32
9 | {
10 | a, b: A;
11 | a.a = [1, 2, 3];
12 | b.a = new a.a[..];
13 | return (b.a[$-1] == 3) ? 0 : 1;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/arrays/041/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | a: i32[;
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/arrays/043/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum VAL = 10;
4 | enum VAL2 = 2;
5 | alias VAI = string;
6 |
7 | fn main() i32
8 | {
9 | arr: i32[VAL + VAL2 + 1];
10 | aa: i32[VAI];
11 | aa["hi"] = 42;
12 | return arr.length == 13 && aa["hi"] == 42 ? 0 : 1;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/arrays/044/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | emptyarr: i32[];
6 | arr1: i32[][];
7 | arr1 ~= cast(i32[])null;
8 | return arr1.length == 1 ? 0 : 1;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/aa/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | aa: f32[i32];
6 | return cast(i32)aa.get(0, 0.0f);
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/bugs/arrays/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | // scope is needed for this bug.
7 | arr: scope string[] = ["s"];
8 | var: string[];
9 | var ~= arr;
10 |
11 | return cast(void*)var[0].ptr !is cast(void*)arr[0].ptr;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/002/test.volt:
--------------------------------------------------------------------------------
1 | // Implicit conversions doesn't work for binops.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | t: size_t = 1;
8 | arr := new i32[](4);
9 | arr[0 .. t + 1];
10 |
11 | str := new char[](1);
12 | str[0] = 20;
13 |
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/003/test.volt:
--------------------------------------------------------------------------------
1 | // Impicit cast to const pointer doesn't work.
2 | module test;
3 |
4 |
5 | fn func(ptr: const(char)*)
6 | {
7 | return;
8 | }
9 |
10 | fn main() i32
11 | {
12 | ptr: char*;
13 | func(ptr);
14 |
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:implicitly convert
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | foo: string = 4;
9 |
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/005/test.volt:
--------------------------------------------------------------------------------
1 | // Implicit int conversion gone wrong.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | t: u8 = 4;
8 | if (t == 4)
9 | return 0;
10 | return 42;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(const(ubyte)**)
4 | {
5 | return;
6 | }
7 |
8 | fn main() i32
9 | {
10 | data: ubyte**;
11 | foo(data);
12 | return 0;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(const(i32**)*)
4 | {
5 | return;
6 | }
7 |
8 | fn bar(arg: const(i32*)**)
9 | {
10 | foo(arg);
11 | }
12 |
13 | fn main() i32
14 | {
15 | return 0;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(const(char*)**)
4 | {
5 | return;
6 | }
7 |
8 | fn main() i32
9 | {
10 | ptr: const(char)**;
11 | foo(&ptr);
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/009/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:implicitly convert
3 | module test;
4 |
5 | class A {}
6 |
7 | fn foo(f: A*[])
8 | {
9 | }
10 |
11 | fn main() i32
12 | {
13 | a: const(A)*[];
14 | foo(a);
15 | return 0;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/010/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | b: bool = true;
7 | u32 uInt = 41;
8 | val := uInt + b;
9 | return cast(i32)val - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/conversion/012/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:implicitly convert
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | foo: char[][1];
9 | foo[0] = "four";
10 | return cast(i32)foo[0].length;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/001/test.volt:
--------------------------------------------------------------------------------
1 | // Auto bug
2 | module test;
3 |
4 |
5 | fn funcReturnsPointer() void* { ptr: void*; return ptr; }
6 |
7 | fn main() i32
8 | {
9 | ptr := funcReturnsPointer();
10 |
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/005/test.volt:
--------------------------------------------------------------------------------
1 | // Unresolved aliases.
2 | module test;
3 |
4 |
5 | // If not used these the inner most useage of foo is not resolved.
6 | alias foo = i32;
7 | alias bar = fn(foo);
8 |
9 | fn main() i32
10 | {
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | abstract class Base
5 | {
6 | fn close()
7 | {
8 |
9 | }
10 | }
11 |
12 | fn main() i32
13 | {
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:unsupported feature
3 | // Opaque structs.
4 | module bugs;
5 |
6 | struct Foo;
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/008/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:unsupported
3 | // Opaque unions.
4 | module bugs;
5 |
6 | union Foo;
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/011/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | alias foo = i32;
4 |
5 | fn main() i32
6 | {
7 | return cast(i32) typeid(foo).size - 4;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct Structure {
4 | fn foo() {
5 | }
6 | }
7 |
8 | global str: Structure;
9 |
10 | fn main() i32
11 | {
12 | fn vdg() { str.foo(); }
13 | return 0;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/014/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | aa: i32[string]; aa["a"] = 11; aa["b"] = 32;
6 | sum: i32;
7 | foreach (k, v; aa) {
8 | sum += v;
9 | }
10 | return sum - 43;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/016/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class C
4 | {
5 | fn foo(a: i32[]...) i32
6 | {
7 | return a[0] + a[1];
8 | }
9 | }
10 |
11 | fn main() i32
12 | {
13 | c := new C();
14 | return c.foo(3, 1) - 4;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/021/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | interface Iface
4 | {
5 |
6 | }
7 |
8 | class Clazz
9 | {
10 | iface: Iface;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/024/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class Base {}
4 | class Sub : Base {}
5 |
6 | fn foo(i32) {}
7 | fn foo(Base) {}
8 |
9 | fn func(out sub: Sub)
10 | {
11 | foo(sub);
12 | }
13 |
14 | fn main() i32
15 | {
16 | return 0;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/026/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | fn got() {}
6 | y := got;
7 |
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/031/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | aa: i32[i32];
6 | aa[1] = 54;
7 | aa[2] = 75;
8 | return cast(i32)(aa.values.length + aa.keys.length) - 4;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/032/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | foo: const(char)[][1];
7 | foo[0] = "four";
8 | return cast(i32)foo[0].length - 4;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/033/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | // immutable somehow explodes.
5 | global arr: immutable(u8)[3];
6 |
7 | fn main() i32
8 | {
9 | return arr[0];
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/034/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import core.typeinfo;
4 |
5 |
6 | fn main() i32
7 | {
8 | ti := typeid(i32);
9 | static is (typeof(ti) == TypeInfo);
10 |
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/035/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum Foo : u32 { one = 1, two, three }
4 |
5 | fn main() i32
6 | {
7 | foo: u32 = Foo.three;
8 | return cast(i32) (Foo.two + foo) - 5;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/036/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | alias Alias = i32;
5 |
6 | fn main() i32
7 | {
8 | foo : Alias;
9 | foo = 42;
10 | return foo - 42;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/037/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct Foo { a: i32; global f: const(Foo) = { 1 }; }
4 |
5 | fn main() i32
6 | {
7 | return Foo.f.a - 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/bugs/declaration/038/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum Foo : i32 = 4;
4 |
5 | fn main() i32
6 | {
7 | return Foo - 4;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/001/test.volt:
--------------------------------------------------------------------------------
1 | // Segfault
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | i := 0;
8 | id := typeid(typeof(i)); // Causes a segfault.
9 |
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:lvalue
3 | // LValue checking is broken.
4 | module test;
5 |
6 |
7 | fn main() i32
8 | {
9 | f: i32[] = new i32[](4);
10 | t := &f[0 .. 5]; // Array slice is not a LValue
11 |
12 | return 0;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/003/test.volt:
--------------------------------------------------------------------------------
1 | // Postfixes on things don't work.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | id := typeid(i32);
8 | str1 := id.mangledName; // Works
9 |
10 | str2 := typeid(i32).mangledName; // Doesn't
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/004/test.volt:
--------------------------------------------------------------------------------
1 | // Invalid escape.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | arr := new char[](1);
8 | arr[0] = '\n';
9 | arr[0] = '\0';
10 |
11 | c: char = '\0';
12 |
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/006/test.volt:
--------------------------------------------------------------------------------
1 | // null not handled to constructors.
2 | module test;
3 |
4 |
5 | class Clazz
6 | {
7 | this(t: string)
8 | {
9 | }
10 | }
11 |
12 | fn main() i32
13 | {
14 | c := new Clazz(null);
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/007/test.volt:
--------------------------------------------------------------------------------
1 | // Array copy to little.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | a1 := new i32[](4);
8 | a2 := new i32[](4);
9 |
10 | a1[2] = 4;
11 | a2[2] = 42;
12 |
13 | a1[] = a2;
14 |
15 | return a1[2] - 42;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/010/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | global foo: fn();
5 |
6 | fn main() i32
7 | {
8 | foo = cast(typeof(foo))null;
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/011/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | global foo: fn();
5 |
6 | fn main() i32
7 | {
8 | f := cast(typeof(foo))null;
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/012/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | global foo: fn();
5 |
6 | fn main() i32
7 | {
8 | foo = null;
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum Foo
4 | {
5 | VAL1 = 2,
6 | VAL2 = 40,
7 | VAL3 = 42,
8 | }
9 |
10 | enum val = Foo.VAL1 | Foo.VAL2;
11 |
12 | fn main() i32
13 | {
14 | flags: Foo = Foo.VAL3;
15 |
16 | return (flags & val) - 42;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/014/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:unexpected array literal
3 | module test;
4 |
5 | fn foo(const(i32*))
6 | {
7 | return;
8 | }
9 |
10 | fn main() i32
11 | {
12 | foo([1,2,3]);
13 | return 0;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/015/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | str := "foo".ptr;
7 | return str[0] == 'f' ? 0 : 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/016/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | i: i32*;
6 | fn get() i32
7 | {
8 | x: i32 = *i;
9 | return x;
10 | }
11 | i = new i32;
12 | *i = 43;
13 | return get() - 43;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/018/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32 {
4 | return cast(i32) typeid(scope dg(i32)).args.length - 1;
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/019/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | sum: i32;
6 | foreach (a; [1, 2, 3]) {
7 | foreach (b; [1, 1, 2]) {
8 | sum += b * a;
9 | }
10 | }
11 | return sum - 24;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/020/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | aa: i32[string];
6 | aa["foo"] = 32;
7 | if (p := "foo" in aa) {
8 | return *p - 32;
9 | } else {
10 | return 2;
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/021/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := [1, 2, 3];
6 | a[0] = 2;
7 | return a[0] - 2;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/022/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn bar(x: i32[]) i32
4 | {
5 | return x[0];
6 | }
7 |
8 | fn foo(out x: i32[]) i32
9 | {
10 | x = [7];
11 | return bar(x);
12 | }
13 |
14 | fn main() i32
15 | {
16 | x: i32[];
17 | return foo(out x) - 7;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/025/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn addOne(ref i: i32)
4 | {
5 | i += 1;
6 | }
7 |
8 | fn set(out i: i32, N: i32)
9 | {
10 | i = N;
11 | }
12 |
13 | fn main() i32
14 | {
15 | x: i32;
16 | x.set(41);
17 | x.addOne();
18 | return x - 42;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/028/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | foo: char[];
6 | bar: string = "42";
7 | foo ~= bar;
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/029/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | foo := dchar.default;
6 | return cast(i32)foo;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/031/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | foo: string = "four";
7 | ret: i32;
8 |
9 | foreach(i, c: char; foo) {
10 | ret = cast(i32)i + 1;
11 | }
12 | return ret - 4;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/035/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | n: size_t = 10;
6 | foreach (i; 0 .. n) {
7 | }
8 | return 0;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/036/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class Foo {}
4 |
5 | fn bar(out var: Foo[])
6 | {
7 | f: Foo;
8 | var ~= f;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/037/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | c: wchar = '\u1234';
6 | c2: dchar = '\U00012340';
7 |
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/038/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a, b: u32;
6 | a = 0x8000_0000U;
7 | b = a >> 1U;
8 | if (b == 0x4000_0000) {
9 | return 0;
10 | } else {
11 | return 17;
12 | }
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/041/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | size_t x = true ? 0 : 4;
6 | return cast(i32) x;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/042/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | enum str1 = "string";
5 | enum string str2 = "string";
6 |
7 | fn main() i32
8 | {
9 | arr: string[] = new string[](3);
10 |
11 | // Both of these fails
12 | arr ~= str1;
13 | arr ~= str2;
14 |
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/044/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | if (["a", "b", "c"] == 3) {
7 | return 1;
8 | }
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/045/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import core.typeinfo : TypeInfo;
4 |
5 |
6 | fn main() i32
7 | {
8 | ti := typeid(i32);
9 | static is (typeof(ti) == TypeInfo);
10 |
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/046/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | extern(C) fn printf(const(char)*, ...) i32;
4 |
5 |
6 | fn main() i32
7 | {
8 | printf("%p\n", null);
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/047/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:tried to assign a void value
3 | module test;
4 |
5 | fn foo()
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | bar := foo();
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/048/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:tried to assign a void value
3 | module test;
4 |
5 | fn foo()
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | bar: void;
12 | bar = foo();
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/049/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | str := "hi";
6 | aBool := true;
7 | aa1: i32[string];
8 | aa1["hi"] = 1;
9 | aa2: i32[string];
10 | c := str in (aBool ? aa1 : aa2);
11 | return *c - 1;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/050/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a: u8;
6 | a += 1;
7 | a++;
8 | return a - 2;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/051/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:convert
3 | module test;
4 |
5 | class Foo {}
6 | class Bar {}
7 |
8 | fn main() i32
9 | {
10 | f := new Foo();
11 | arr: Bar[];
12 | arr ~= f;
13 |
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/052/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:convert
3 | module test;
4 |
5 | class Foo {}
6 | class Bar {}
7 |
8 | fn main() i32
9 | {
10 | f := new Foo[](1);
11 | arr: Bar[];
12 | arr ~= f;
13 |
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/expression/053/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(v: u32, i: u32 = 0)
4 | {
5 | }
6 |
7 | fn main() i32
8 | {
9 | foo(v:1);
10 | foo(v:1);
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:implicitly convert
3 | // Arrays of arrays gets accepted.
4 | module bugs;
5 |
6 |
7 | fn main() i32
8 | {
9 | return func("bug here");
10 | }
11 |
12 | fn func(f: string[]) i32
13 | {
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn f(...) {
4 | }
5 |
6 | fn main(args: string[]) i32 {
7 | fn vdg() {}
8 | f(vdg);
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(ref s: string)
4 | {
5 | s = "hi";
6 | }
7 |
8 | fn foo(ref i: i32)
9 | {
10 | i = 17;
11 | }
12 |
13 | fn main() i32
14 | {
15 | x: i32;
16 | foo(ref x);
17 | return x - 17;
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn b(ref val: i32)
4 | {
5 | fn dgt(param: i32) { val = param; }
6 | val = 7;
7 | }
8 |
9 | fn main() i32
10 | {
11 | val: i32;
12 | b(ref val);
13 | return val - 7;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn a()
4 | {
5 | fn func() {}
6 | }
7 |
8 | fn a(x: i32)
9 | {
10 | fn func2() {}
11 | }
12 |
13 | fn main() i32
14 | {
15 | return 0;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn wf(strings: string[]...) i32
4 | {
5 | return cast(i32) strings[0].length;
6 | }
7 |
8 | fn wf(x: i32) i32
9 | {
10 | return 7;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return wf("hello") - 5;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/009/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(s: string[]...) i32
4 | {
5 | return 7;
6 | }
7 |
8 | fn foo(x: i32) i32
9 | {
10 | return 9;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return 7 - foo("hello", "world");
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/011/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import core.object : Object;
4 |
5 | fn frozknobble(out obj: Object)
6 | {
7 | obj2: Object = obj;
8 | }
9 |
10 | fn main() i32
11 | {
12 | obj := new Object();
13 | frozknobble(out obj);
14 | return 0;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/function/012/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | // From D's static
6 | global fn foo() i32 {
7 | return 42;
8 | }
9 |
10 | return foo() - 42;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import b;
5 |
6 | fn foo(Location)
7 | {
8 | }
9 |
10 | fn main() i32
11 | {
12 | l: Location;
13 | foo(l);
14 | return 0;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module b;
3 |
4 | static import a;
5 |
6 | fn main() i32
7 | {
8 | return a.bork(1) - 1;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import c;
5 | import d;
6 |
7 | fn main() i32
8 | {
9 | return foo(3) - 6;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/attributeBug/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import ol;
5 |
6 | fn main() i32
7 | {
8 | o: OVERLAPPED;
9 | o.Internal = 32;
10 | return o.Internal - 32;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/deps/a.volt:
--------------------------------------------------------------------------------
1 | module a;
2 |
3 | fn bork() i32
4 | {
5 | return 0;
6 | }
7 |
8 | fn bork(x: i32) i32
9 | {
10 | return 1;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/deps/b.volt:
--------------------------------------------------------------------------------
1 | module b;
2 |
3 | struct Location
4 | {
5 | filename: string;
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/deps/c.volt:
--------------------------------------------------------------------------------
1 | module c;
2 |
3 | fn foo() i32
4 | {
5 | return 0;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/deps/d.volt:
--------------------------------------------------------------------------------
1 | module d;
2 |
3 | fn foo(x: i32) i32
4 | {
5 | return x * 2;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/bugs/import/deps/ol.volt:
--------------------------------------------------------------------------------
1 | module ol;
2 |
3 | public:
4 |
5 | struct OVERLAPPED
6 | {
7 | private Blah: i32;
8 | Internal: i32;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/lookup/002/test.volt:
--------------------------------------------------------------------------------
1 | // Static lookups in classes
2 | module test;
3 |
4 |
5 | class Foo
6 | {
7 | this()
8 | {
9 | return;
10 | }
11 |
12 | enum i32 foo = 42;
13 | }
14 |
15 | fn main() i32
16 | {
17 | return Foo.foo - 42;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/bugs/lookup/010/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum Enum { A, B, C }
4 |
5 | fn main() i32
6 | {
7 | e := Enum.B;
8 | switch (e) with (Enum) {
9 | default:
10 | case A, C: return 32;
11 | case B: return 0;
12 | }
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/bugs/lookup/012/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn wf(strings: string[]...) i32
4 | {
5 | return cast(i32) strings[0].length;
6 | }
7 |
8 | fn wf(x: i32) i32
9 | {
10 | return 7;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return wf("hello") - 5;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/rt/test/bugs/lookup/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn getoptImpl(dgt: scope dg()) i32
4 | {
5 | return 1;
6 | }
7 |
8 | fn getoptImpl(dgt: scope dg(string)) i32
9 | {
10 | return 2;
11 | }
12 |
13 | fn main() i32
14 | {
15 | fn dgt() {}
16 | return getoptImpl(dgt) - 1;
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/rt/test/bugs/lookup/018/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | struct S
5 | {
6 | _x: i32;
7 |
8 | @property fn x() i32
9 | {
10 | return _x;
11 | }
12 | }
13 |
14 | fn main() i32
15 | {
16 | s: S;
17 | s.x = 12;
18 | return s.x;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/rt/test/bugs/parse/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | hello I should not compile but it happens that I succeed
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/bugs/parse/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn make(string name,(i32 vb) i32
5 | {
6 | return vb;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return make("apple", 12);
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/bugs/template/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn tmpl!(T)(t: T) T { return t; }
4 |
5 | fn main() i32
6 | {
7 | tmplInstance(0);
8 | return 0;
9 | }
10 |
11 | // This must come after main, to force it to be unresolved as main looks it up.
12 | fn tmplInstance = tmpl!(i32);
13 |
--------------------------------------------------------------------------------
/rt/test/cfg/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main(args: string[]) i32
5 | {
6 | x: i32;
7 | if (args.length >= 1) {
8 | return 0;
9 | x++;
10 | }
11 | return x;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/cfg/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:continue
3 | module test;
4 |
5 | fn foo()
6 | {
7 | continue;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return 0;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/cfg/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:break
3 | module test;
4 |
5 | fn foo()
6 | {
7 | break;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return 0;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/cfg/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import core.exception;
4 |
5 | fn voidFunc(test: bool)
6 | {
7 | if (test) {
8 | return;
9 | } else {
10 | test = true;
11 | }
12 | }
13 |
14 | fn main() i32
15 | {
16 | voidFunc(false);
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/cfg/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn f01(b: bool)
5 | {
6 | return;
7 | assert(false);
8 | }
9 |
10 | fn main() i32
11 | {
12 | f01(false);
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/cfg/011/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:statement not reached
3 | module test;
4 |
5 | int main()
6 | {
7 | while (true) {
8 | }
9 | return 0;
10 | }
--------------------------------------------------------------------------------
/rt/test/cfg/infiniteDoWhile/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:do-not-link
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | do {
7 | } while(true);
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/cfg/infiniteDoWhileFailure/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:statement not reached
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | do {
8 | } while(true);
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/compiletime/cond/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | static assert(false, "if you can read this, I'm working!");
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/compiletime/cond/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | static assert(true, "if you can read this, I'm not working!");
6 | return 0;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/compiletime/cond/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:release
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | x: i32;
7 | debug x = 32;
8 | return x;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/compiletime/cond/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:debug
2 | module test;
3 |
4 | int main()
5 | {
6 | x: i32 = 32;
7 | debug x = 0;
8 | return x;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/compiletime/exps/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | // Minimal testing of compile time evaluation of expressions.
4 | enum Foo = 4;
5 | enum Bar = Foo + 5;
6 | enum Fizz = Bar / 2;
7 |
8 | fn main() i32
9 | {
10 | return Fizz != 4 ? 1 : 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/compiletime/exps/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | // Minimal testing of compile time evaluation of expressions.
4 | enum Bits = typeid(i32).size * 8;
5 |
6 | fn main() i32
7 | {
8 | return Bits != 32 ? 1 : 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/ctfe/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:syntax-only
2 | module test;
3 |
4 | fn f() i32
5 | {
6 | return 1;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return #run f();
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/ctfe/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:7:
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | fn nested() i32 { return 7; }
8 | return #run nested();
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/ctfe/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn six() i32
4 | {
5 | a: i32 = 2;
6 | return (4 + a) - 6;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return #run six();
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/ctfe/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn six() i32
4 | {
5 | a: i32 = 2;
6 | if (a == 2) {
7 | return 0;
8 | }
9 | return 2 + a;
10 | }
11 |
12 | fn main() i32
13 | {
14 | return #run six();
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/ctfe/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn thirty() i32
4 | {
5 | return 30;
6 | }
7 |
8 | fn sixty() i32
9 | {
10 | return (thirty() * 2) - 60;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return #run sixty();
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/ctfe/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn dbl(n: i32) i32
4 | {
5 | return n * 0;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return #run dbl(20);
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/ctfe/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn x() i32
4 | {
5 | j: i32;
6 | foreach (i; 0 .. 10) {
7 | j += i;
8 | }
9 | return j - 45;
10 | }
11 |
12 | fn main() i32
13 | {
14 | return #run x();
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/ctfe/010/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn x() u8
4 | {
5 | return cast(u8)261;
6 | }
7 |
8 | fn main() i32
9 | {
10 | y: i32 = #run x();
11 | return y - 5;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/ctfe/011/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn thirty(mult: i32) i32
4 | {
5 | return 30 * mult;
6 | }
7 |
8 | fn sixty(n: i32) i32
9 | {
10 | two: i32 = 1 + n;
11 | return thirty(two) - 60;
12 | }
13 |
14 | fn main() i32
15 | {
16 | return #run sixty(1);
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/ctfe/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn frimulize(a: i32, b: i32) i32
4 | {
5 | return a + b;
6 | }
7 |
8 | fn frobulate(a: i32) i32
9 | {
10 | return frimulize(12, a * 2) - 24;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return #run frobulate(6);
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/ctfe/016/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn twenty() i32
4 | {
5 | return 0;
6 | }
7 |
8 | enum Twenty = #run twenty();
9 |
10 | fn main() i32
11 | {
12 | return Twenty;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/ctfe/017/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo() f32
4 | {
5 | return 0.0f + 0.5f;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return (#run foo()) >= 0.25f ? 0 : 3;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/ctfe/018/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo() f64
4 | {
5 | return 0.0 + 0.5;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return (#run foo()) >= 0.25 ? 0 : 3;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/ctfe/019/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(f: f32) i32
4 | {
5 | if (f >= 0.25f) {
6 | return 0;
7 | }
8 | return 3;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return #run foo(0.5f);
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/ctfe/020/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(f: f64) i32
4 | {
5 | if (f >= 0.25) {
6 | return 0;
7 | }
8 | return 3;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return #run foo(0.5);
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/ctfe/021/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum
4 | {
5 | A = 0u
6 | }
7 |
8 | enum
9 | {
10 | B = A
11 | }
12 |
13 | fn main() i32
14 | {
15 | return B;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/ctfe/022/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | alias A = u32;
4 | enum u32 E0 = 0u;
5 | enum u32 E1 = typeid(A).size * 8u;
6 | enum u32 E2 = E0 / E1 == 0u ? 2u : E0 / E1;
7 |
8 | fn main() i32
9 | {
10 | return cast(i32)(E2 - 2);
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/ctfe/i32Mod/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum A = 10 % 3;
4 |
5 | fn main() i32
6 | {
7 | return A - 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/doccomments/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | /**
4 | * A doc comment!
5 | */
6 | fn close();
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/enum/simpleBool/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | enum Bool
4 | {
5 | True = false,
6 | False = true,
7 | }
8 |
9 | fn main() i32
10 | {
11 | return !Bool.False ? 1 : 0;
12 | }
--------------------------------------------------------------------------------
/rt/test/errors/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:8:8: error: unidentified identifier 'y'.
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | x: i32;
8 | return y;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/rt/test/errors/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:5:19: error:
3 | module test;
4 |
5 | fn foo(s: string = 42) i32
6 | {
7 | return 0;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return foo();
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/errors/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:5:16: error: expected
3 | module test;
4 |
5 | fn isSet(string key) void {}
6 |
7 | fn main() i32
8 | {
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/errors/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:12:8: error: enum 'A' does not define 'C'.
3 | module test;
4 |
5 | enum A
6 | {
7 | B
8 | }
9 |
10 | fn main() i32
11 | {
12 | return A.C;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/errors/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:5:10: error: @property functions with no arguments like 'foo' cannot have a void return type.
3 | module test;
4 |
5 | @property fn foo()
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/errors/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | @mangledname("llvm.floor.f64") fn floor();
5 |
--------------------------------------------------------------------------------
/rt/test/errors/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:is in use
3 | module test;
4 |
5 | alias A = i32;
6 | global A: u32;
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/errors/008/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:used before declaration
3 | module test;
4 |
5 | fn main(args: string[]) i32
6 | {
7 | if (args.length > 0) {
8 | x = 32;
9 | }
10 | x: i32;
11 | return x;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/errors/009/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:property function
3 | module test;
4 |
5 | @property fn foo() i32
6 | {
7 | return 0;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return foo();
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/errors/010/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot cast aggregate
3 | module test;
4 |
5 | struct S
6 | {
7 | i: i32;
8 | }
9 |
10 | fn main() i32
11 | {
12 | s: S;
13 | s.i = 42;
14 | i := cast(i32)s;
15 | return i - 42;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/errors/011/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected lvalue to out parameter
3 | module test;
4 |
5 | fn foo(out var: bool)
6 | {
7 | var = true;
8 | }
9 |
10 | fn main() i32
11 | {
12 | foo(true);
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/012/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected lvalue to ref parameter
3 | module test;
4 |
5 | fn foo(ref var: bool)
6 | {
7 | var = true;
8 | }
9 |
10 | fn main() i32
11 | {
12 | foo(true);
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/014/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected
3 | module test;
4 |
5 | fn main(args: string[],) i32
6 | {
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/errors/015/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected
3 | module test;
4 |
5 | int main(string[] args,)
6 | {
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/errors/016/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected
3 | module test;
4 |
5 | fn add(a: i32, b: i32) i32
6 | {
7 | return a + b;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return add(1, 2,);
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/errors/019/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected a composable
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | a := new "hello";
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/errors/020/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:use 'is' for
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | ptr: void*;
8 | b := ptr == null;
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/errors/021/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | aa: i32[string];
8 | aa = null;
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/errors/022/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:unsupported feature
3 | module test;
4 |
5 | class A {}
6 |
7 | fn foo(a: A[]...)
8 | {
9 | }
10 |
11 | fn main() i32
12 | {
13 | foo(null);
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/errors/023/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class A {}
4 |
5 | fn foo(a: A[]...)
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | foo(cast(A)null);
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/errors/024/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | for (i: size_t 0; i < 10; ++i) {
7 | }
8 | return 0;
9 | }
--------------------------------------------------------------------------------
/rt/test/errors/025/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected ':'
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | x := 74;
8 | switch (x) {
9 | case 0 .. 75:
10 | return 1;
11 | default:
12 | return 2;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/026/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected 'case'
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | x := 74;
8 | switch (x) {
9 | case 0: .. 75:
10 | return 1;
11 | default:
12 | return 2;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/028/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:does not match
3 | module test;
4 |
5 | private import m1 : add;
6 |
7 | fn add(a: i32, b: i32) i32
8 | {
9 | return a + b;
10 | }
11 |
12 | fn main() i32
13 | {
14 | return add(1, 2, 3) - add(3, 3);
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/errors/029/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:does not match
3 | module test;
4 |
5 | import m1 : add;
6 |
7 | fn add(a: i32, b: i32) i32
8 | {
9 | return a + b;
10 | }
11 |
12 | fn main() i32
13 | {
14 | return add(1, 2, 3) - add(3, 3);
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/errors/030/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | public import m1 : add;
5 |
6 | fn add(a: i32, b: i32) i32
7 | {
8 | return a + b;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return add(1, 2, 3) - add(3, 3);
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/031/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m2;
5 |
6 | fn main() i32
7 | {
8 | return add(3, 3) - 6;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/errors/032/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m2;
5 |
6 | fn main() i32
7 | {
8 | return pubadd(3, 3) - 6;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/errors/033/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:test.volt:7
3 | module test;
4 |
5 | enum Count : u32 = 8u * 1024u * 1024u /*;*/
6 |
7 | fn main() i32
8 | {
9 | return 0;
10 | }
--------------------------------------------------------------------------------
/rt/test/errors/034/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:test.volt:7
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | str := "${+}";
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/errors/036/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | module test;
4 |
5 | fn BadFunc()
6 | {
7 | return true;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/errors/038/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn init(x: i32)
4 | {
5 | }
6 |
7 | fn main() i32
8 | {
9 | init(12);
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/errors/039/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S
4 | {
5 | local init: i32;
6 | }
7 |
8 | fn main() i32
9 | {
10 | S.init = 32;
11 | return S.init - 32;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/errors/040/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:specified multiple times
3 | module test;
4 |
5 | fn foo(x: u32, y: u32) {}
6 |
7 | fn main() i32
8 | {
9 | // Notice two x.
10 | foo(x: 1, x: 2);
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/errors/043/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:neither ref nor out
3 | module test;
4 |
5 | fn flubber(x: i32) i32
6 | {
7 | return x;
8 | }
9 |
10 | fn main() i32
11 | {
12 | integer := 6;
13 | return flubber(ref integer);
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/044/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:got an expression where
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | xyz := 32;
8 | y := new xyz;
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/errors/045/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:res-failure
2 | //T check:string import path with '..'.
3 |
4 | fn main() i32
5 | {
6 | str := import("../044/test.volt");
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/errors/047/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:symbol 'x' redefinition
3 | module test;
4 |
5 | class Parent
6 | {
7 | x: i32;
8 | }
9 |
10 | class Child : Parent
11 | {
12 | x: i32;
13 | }
14 |
15 | fn main() i32
16 | {
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/errors/049/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:8:6: error: cannot
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | a := 32;
8 | b := new "${\"hello\" ~ a}";
9 | return a - 32;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/errors/050/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:error
3 | // This was an infinite loop, hence the vague check.
4 | module test;
5 |
6 | fn main() i32 {
7 | foo := (
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/errors/051/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:error
3 | // This was another infinite loop, hence the vague check.
4 | module test;
5 |
6 | fn main() i32 {
7 | asm {
8 | return 0;
9 |
--------------------------------------------------------------------------------
/rt/test/errors/052/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | fn foo() i32
7 | {
8 | return 12;
9 | }
10 | return foo();
11 | }
12 |
13 | alias StringStack = Foo
--------------------------------------------------------------------------------
/rt/test/errors/deps/m1.volt:
--------------------------------------------------------------------------------
1 | module m1;
2 |
3 | fn add(a: i32, b: i32, c: i32) i32
4 | {
5 | return a + b + c;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/errors/deps/m2.volt:
--------------------------------------------------------------------------------
1 | module m2;
2 |
3 | private fn add(a: i32, b: i32) i32
4 | {
5 | return a + b;
6 | }
7 |
8 | alias pubadd = add;
9 |
--------------------------------------------------------------------------------
/rt/test/errors/foreachArrayNoIndex/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module main;
3 |
4 | fn main() i32
5 | {
6 | a := [1, 2, 3];
7 | foreach (a) {
8 | }
9 | return 0;
10 | }
--------------------------------------------------------------------------------
/rt/test/errors/foreachRangeIndex/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:foreach over range cannot take an index variable
3 | module main;
4 |
5 | fn main() i32 {
6 | foreach (i, n; 5 .. 10) {
7 | }
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/errors/returnInScope/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:return statements inside of scope
3 | module test;
4 |
5 | fn alpha() i32
6 | {
7 | scope (exit) return;
8 | return 2;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return alpha();
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/scopeInScope/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:scope statements inside of scope
3 | module test;
4 |
5 | fn alpha() i32
6 | {
7 | scope (exit) scope (exit) a := 2;
8 | return 2;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return alpha();
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/errors/unterminatedComposable/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected
3 | module main;
4 |
5 | fn main() i32
6 | {
7 | x := 1;
8 | str := new "${x}${x";
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/assignment/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot modify
3 | // Ensure that const values can't be assigned to.
4 | module test;
5 |
6 | fn main() i32
7 | {
8 | i: const(i32);
9 | i = 42;
10 | return i;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/assignment/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:escape through assignment
3 | // MI to global scope assignment.
4 | module test;
5 |
6 | global sip: scope(i32*) = null;
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/assignment/003/test.volt:
--------------------------------------------------------------------------------
1 | // non-MI to scope assignment.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | i: i32 = 17;
7 | si: scope(i32) = i;
8 | return si - 17;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/assignment/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:escape through assignment
3 | module test;
4 |
5 | global x: scope i32*;
6 |
7 | fn main() i32
8 | {
9 | y: scope i32* = null;
10 | x = y;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/assignment/shiftAssigns/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | fn main() i32 {
4 | a := 2;
5 | b := 128;
6 | a <<= 1;
7 | b >>= a;
8 | b >>>= 1;
9 | return b - 4;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/001/test.volt:
--------------------------------------------------------------------------------
1 | // Test addition.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return -2 + 1 + 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/002/test.volt:
--------------------------------------------------------------------------------
1 | // Simple subtraction.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return 4 - 4;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/003/test.volt:
--------------------------------------------------------------------------------
1 | // Combining addition and subtraction.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return 12 - 6 + 12 - 6 - 12;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/004/test.volt:
--------------------------------------------------------------------------------
1 | // Multiplication and evaluation order.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return (4 * 5 - 5) - 15;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/005/test.volt:
--------------------------------------------------------------------------------
1 | // Parens and order of evaluation.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return (4 * (5 - 1)) - 16;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/007/test.volt:
--------------------------------------------------------------------------------
1 | // Simplest simple exptyper test is simple.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return (true ? 6 : 3) + (false ? 3 : 7) - 13;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | enum {
5 | a = 1,
6 | b = 7,
7 | c = 3,
8 | }
9 |
10 | fn main() i32
11 | {
12 | return a + c - 4;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/009/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | a: i32 = 2;
7 | b: i32 = 3;
8 | a * b;
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/010/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct c {}
4 |
5 | fn main() i32
6 | {
7 | d: c*;
8 | a: i32 = 2;
9 | b: i32 = 3;
10 | (a * b);
11 | return (a * b) - 6;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/011/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | alias a = i32;
5 |
6 | fn main() i32
7 | {
8 | (a * b);
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/012/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a: bool = 1.2 || 3.4;
6 | return a ? 0 : 15;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/expression/binop/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := 32;
6 | b: i32 = 7;
7 | c, d: i32;
8 | c = 1;
9 | return (a + b + c + d) - 40;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/cast/001/test.volt:
--------------------------------------------------------------------------------
1 | // Tests float literals and truncating casts.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | f: f32 = 100.56f;
8 | return cast(i32)f - 100;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot use type
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | str := new "${main}";
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum Enum
4 | {
5 | Zero,
6 | One,
7 | }
8 |
9 | fn func(arg: i32) string
10 | {
11 | return new "${Enum.One} + ${arg}";
12 | }
13 |
14 | fn main() i32
15 | {
16 | assert(func(32) == "One + 32");
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | str := "\\ ${32}";
6 | assert(str == `\ 32`);
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := "hello";
6 | b := ["world"];
7 | assert(new "${a}" == `hello`);
8 | assert(new "${b}" == `["world"]`);
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | c := 'a';
6 | assert(new "${c}" == `a`, new "${c}");
7 | assert("${'a'}" == `a`, "${'a'}");
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:non constant expression
3 | module test;
4 |
5 | fn main(args: string[]) i32
6 | {
7 | str := "${args.length}";
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | val := new "${ \"a\" }";
6 | return val == "a" ? 0 : 1;
7 | }
--------------------------------------------------------------------------------
/rt/test/expression/compose/009/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | val := new "${ [ \"a\" : 12 ] }";
6 | return val == `["a":12]` ? 0 : 1;
7 | }
--------------------------------------------------------------------------------
/rt/test/expression/compose/escapeBackslash/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | fn main() i32
4 | {
5 | str := new "${12} \\${12} \${12} \t${12}";
6 | if (str != `12 \12 ${12} 12`) {
7 | return 1;
8 | } else {
9 | return 0;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/escapeBackslashDetection/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | fn main() i32
4 | {
5 | str := new "\\${12}";
6 | if (str != `\12`) {
7 | return 1;
8 | } else {
9 | return 0;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/compose/ternary/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | fn main() i32
4 | {
5 | a := new "${5 > 2 ? \"hello\" : \"bar\"}";
6 | if (a != "hello") {
7 | return 1;
8 | }
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/constants/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(x: i32 = __LINE__) i32
4 | {
5 | return x;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return foo() + foo() - 20;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/constants/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main(args: string[]) i32
4 | {
5 | return __LOCATION__[$-11 .. $] == "test.volt:5" ? 0 : 15;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/expression/constants/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a: i8 = -128;
6 | return cast(i32)a + 128;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/expression/constants/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | a: i8 = -129;
8 | return cast(i32)a + 129;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/dereference/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot modify
3 | // Test transitive dereferencing.
4 | module test;
5 |
6 |
7 | fn main() i32
8 | {
9 | i: i32 = 42;
10 | const p = &i;
11 | *p = 42;
12 | return i;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/expression/dereference/002/test.volt:
--------------------------------------------------------------------------------
1 | // Test transitive dereferencing.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | i: i32 = 21;
8 | const p = &i;
9 | return *p - 21;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/001/test.volt:
--------------------------------------------------------------------------------
1 | // Test implicit conversion from const using mutable indirection.
2 | module test;
3 |
4 | fn foo(i: i32)
5 | {
6 | }
7 |
8 | fn main() i32
9 | {
10 | i: const(i32);
11 | foo(i);
12 | return 0;
13 | }
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | // scope with MI to non scope.
4 | module test;
5 |
6 |
7 | fn main() i32
8 | {
9 | sip: scope(i32*);
10 | ip: i32* = sip;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/006/test.volt:
--------------------------------------------------------------------------------
1 | // scope with MI to non scope.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | si: scope(i32) = 28;
8 | i: i32 = si;
9 | return i - 28;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/007/test.volt:
--------------------------------------------------------------------------------
1 | // Ensure that immutable can become const with no mutable indirection.
2 | module test;
3 |
4 |
5 | fn foo(const(char)[])
6 | {
7 | }
8 |
9 | int main()
10 | {
11 | str: immutable(char)[];
12 | foo(str);
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/010/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | c: char;
9 | p: scope i32*;
10 | p = &c;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/013/test.volt:
--------------------------------------------------------------------------------
1 | // Passing MI to scope type argument.
2 | module test;
3 |
4 |
5 | fn func(ptr: scope i32*) i32
6 | {
7 | return *ptr;
8 | }
9 |
10 | fn main() i32
11 | {
12 | i: i32 = 8;
13 | ip: i32* = &i;
14 | return func(ip) - 8;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/015/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | global x: scope i32*;
4 |
5 | fn foo(z: scope i32*)
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | y: scope i32* = x;
12 | foo(x);
13 | return 0;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/017/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | // Mismatched types.
4 | module test;
5 |
6 |
7 | fn main() i32
8 | {
9 | return true ? 3 : "foo";
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/018/test.volt:
--------------------------------------------------------------------------------
1 | // Condition to bool.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return 1 ? 0 : 2;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/implicit-conversion/019/test.volt:
--------------------------------------------------------------------------------
1 | // Test converting int implicitly to float.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | a: i32 = 42;
8 | b: f32;
9 | c: f32 = b + a;
10 | return cast(i32)c - 42;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/001/test.volt:
--------------------------------------------------------------------------------
1 | // Hexadecimal literals.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return 0x10 - 16;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | uB: u8 = 0xff;
6 | sB: i8 = cast(i8)-1;
7 |
8 | return
9 | (cast(i32)uB == 0xff) +
10 | (cast(u32)uB == cast(u32)0xff) +
11 | (cast(u32)sB == cast(u32)0xffff_ffff) - 3;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | arr := [[1, 2, 3],[4, 5, 6]];
6 | return arr[$-1][$-1] - 6;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := [1, 6, 7] ~ [2, 4];
6 | return a[1] + a[3] + a[4] - 12;
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | x: i32[2];
6 | x = [1, 2];
7 | return x[0] + x[1] - 3;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected static array literal of length 2
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | x: i32[2];
8 | x = [1, 2, 3];
9 | return x[0] + x[1];
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | x: i32[2];
8 | x = ["dsds", "summer"];
9 | return x[0] + x[1];
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | x: i32[2];
6 | a: i32 = 1;
7 | b: i32 = 2;
8 | x = [a, b];
9 | return x[0] + x[1] - 3;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/009/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct TwoNumbers
4 | {
5 | a, b: i32;
6 | }
7 |
8 | fn main() i32
9 | {
10 | c: i32 = 12;
11 | d: i32 = 3;
12 | tn: TwoNumbers = {c, d};
13 | return tn.a + tn.b - 15;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/011/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | s: string = `\`;
6 | ss: string = "\''";
7 | sss: string = r"\";
8 | return cast(int) (s.length + ss.length + sss.length) - 4;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/012/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | foo := "foo";
7 | bar := foo "bar";
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | if (0xFFFF_FFFF_i32 != -1) {
6 | return 1;
7 | }
8 | if (0xFF_i8 != -1) {
9 | return 3;
10 | }
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/014/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | return 0xFFi32;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/expression/literal/exponentLiterals/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | if (4.0e2 <= 399.99 || 4.0e2 >= 400.01) {
6 | return 1;
7 | }
8 | if (4.12e-2 <= 0.0411 || 4.12e-2 >= 0.0413) {
9 | return 2;
10 | }
11 | return 0;
12 | }
--------------------------------------------------------------------------------
/rt/test/expression/literal/simpleRaw/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | if (r"aaa\aaa\aaa" != `aaa\aaa\aaa`) {
6 | return 1;
7 | }
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn add(a: i32, b: i32) i32
4 | {
5 | return a + b;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return add(a:16, b:16) - 32;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:all arguments must be labelled
3 | module test;
4 |
5 | fn add(a: i32, b: i32) i32
6 | {
7 | return a + b;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return add(a:16, 16);
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(a: i32, b: i32) i32
4 | {
5 | return (a + 2) * b;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return foo(b:2, a:14) - 32;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:calls to @label functions
3 | module test;
4 |
5 | @label fn add(a: i32, b: i32) i32
6 | {
7 | return a + b;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return add(16, 16);
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn add(a: i32, b: i32, c: i32 = 3) i32
4 | {
5 | return a + b + c;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return add(a:16, b:16) - 35;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn addOne(out x: i32)
4 | {
5 | // x is initialized to zero.
6 | x++;
7 | }
8 |
9 | fn main() i32
10 | {
11 | x: i32 = 22;
12 | addOne(out x);
13 | return x - 1;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/009/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S {
4 | x: i32;
5 | }
6 |
7 | fn main() i32
8 | {
9 | s: S;
10 | s.x = 32;
11 | s = S.default;
12 | return s.x;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/010/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import core.object : Object;
4 |
5 | fn main() i32
6 | {
7 | obj := Object.default;
8 | return obj is null ? 0 : 27;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/011/test.volt:
--------------------------------------------------------------------------------
1 | // Reordering arguments with labels.
2 | module test;
3 |
4 | @label fn sub(a: i32, b: i32) i32
5 | {
6 | return a - b;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return sub(b:1, a:3) - 2;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/012/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:all arguments must be labelled
3 | module test;
4 |
5 | @label fn sub(a: i32, b: i32) i32 {
6 | return a - b;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return sub(1, a:3);
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/013/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | struct Foo
5 | {
6 | struct Blarg
7 | {
8 | }
9 | }
10 |
11 | fn main() i32
12 | {
13 | f := Foo.Blarg + 3;
14 |
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/tdefault/nontype/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:.default on non-type expression
3 | module test;
4 |
5 | alias A = i32;
6 |
7 | fn main() i32
8 | {
9 | a: A;
10 | return a.default;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/postfix/tdefault/simpleFailure/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:unidentified identifier 'init'
3 | module test;
4 |
5 | struct S
6 | {
7 | x: i32;
8 | }
9 |
10 | fn main() i32
11 | {
12 | s := S.init;
13 | return s.x;
14 | }
--------------------------------------------------------------------------------
/rt/test/expression/postfix/tdefault/simpleWorking/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S
4 | {
5 | x: i32;
6 | }
7 |
8 | fn main() i32
9 | {
10 | s := S.default;
11 | return S.default.x + i32.default;
12 | }
--------------------------------------------------------------------------------
/rt/test/expression/primitive/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | return i8.max - 90 - 37;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/expression/primitive/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | alias BOOLEAN_TYPE_ALIAS_TOP_SECRET = bool;
4 |
5 | fn main() i32
6 | {
7 | return BOOLEAN_TYPE_ALIAS_TOP_SECRET.max == 1 ? 0 : 1;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/primitive/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:neither field, nor property
3 | // Ensure that instances can't be checked for types.
4 | module test;
5 |
6 | fn main() i32
7 | {
8 | flibber: i32;
9 | return flibber.min;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/primitive/004/test.volt:
--------------------------------------------------------------------------------
1 | // Pointer in paren expression.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | return (void*).min;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/expression/primitive/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot implicitly convert
3 | // Big data types should have big maxes.
4 | module test;
5 |
6 | fn main() i32
7 | {
8 | return u64.max;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/primitive/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn aNumber(n: i32 = i32.max) i32
4 | {
5 | return n;
6 | }
7 |
8 | fn main() i32
9 | {
10 | if (aNumber() == i32.max) {
11 | return 0;
12 | }
13 | return 3;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/expression/type/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | alias IntArray = i32[];
4 |
5 | fn main() i32
6 | {
7 | y := [1, 2, 3];
8 | y = IntArray.default;
9 | return cast(i32)y.length;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/type/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | y := [1, 2, 3];
6 | y = (i32[]).default;
7 | return cast(i32)y.length;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/type/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | alias IntPointer = i32*;
4 |
5 | fn main() i32
6 | {
7 | i: i32;
8 | p := &i;
9 | p = IntPointer.default;
10 | return cast(i32)p;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/type/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | i: i32;
6 | p := &i;
7 | p = (i32*).default;
8 | return cast(i32)p;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/typeid/002/test.volt:
--------------------------------------------------------------------------------
1 | // Anon base typed enum.
2 | module test;
3 |
4 |
5 | enum : u32
6 | {
7 | FOO = 5,
8 | }
9 |
10 | fn main() i32
11 | {
12 | if (typeid(typeof(FOO)) is typeid(u32))
13 | return 0;
14 | return 42;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/expression/typeid/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | if (is(const(i32) == const(i32))) {
7 | return 0;
8 | } else {
9 | return 2;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/typeof/001/test.volt:
--------------------------------------------------------------------------------
1 | // Tests correct functioning of typeof.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | i: i32 = 1;
8 | AnInteger: typeof(i++) = 41; // i should not mutate.
9 | return (AnInteger + i) - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/typeof/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expression has no type
3 | module test;
4 |
5 | import core.object;
6 |
7 | fn main() i32
8 | {
9 | typeof(core) foo;
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/expression/typeof/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | foo: immutable i32;
7 |
8 | i1: typeof(foo + 4);
9 | i2: typeof(4 + foo);
10 |
11 | i1 = 20;
12 | i2 = 22;
13 |
14 | return i1 + i2 - 42;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | val21: i32 = 21;
6 | val20: i32 = --val21;
7 | val21 = ++val20;
8 |
9 | return val21 + val20 - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := [1, 2, 3];
6 | b := new a[0 .. 2];
7 | a[0] = 2;
8 | return b[0] + cast(i32)b.length - 3;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S {
4 | x: i32[];
5 | }
6 |
7 | fn main() i32
8 | {
9 | s: S;
10 | s.x = new int[](12);
11 | s.x[0] = 3;
12 | b := new s.x[0 .. $];
13 | b[0] = 1;
14 | return s.x[0] + b[0] - 4;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | buf := new char[](1);
6 | buf[0] = 'a';
7 | str := new string(buf);
8 | buf[0] = 'b';
9 | return str[0] == 'a' ? 0 : 4;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | arg: i32[] = [3, 4, 5];
7 | i: size_t = 0;
8 |
9 | // Make sure that side effects only happens once.
10 | arg = new arg[0 .. ++i];
11 |
12 | return cast(i32)i - 1;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a := i32(12);
6 | b := new i32(4);
7 | return a + *b - 16;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/008/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected only one argument
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | a := i32(12);
8 | b := new i32(4, 2);
9 | return a + *b;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/009/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected pointer
3 | module test;
4 |
5 | class A
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | a := new A();
12 | de := *a;
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/010/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected integral or bool value
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | de := !"hello";
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/011/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected integral value
3 | module test;
4 |
5 | class A
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | a := new A();
12 | de := +a;
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/012/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected non-void pointer
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | p: void*;
8 | c := *p;
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/expression/unary/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum AnEnum
4 | {
5 | Value = 320
6 | }
7 |
8 | fn main() i32
9 | {
10 | a := new i32[](AnEnum.Value);
11 | a[160] = 32;
12 | return a[160] - (a[243] + 32);
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/function/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn hitotu(out i: i32)
4 | {
5 | i = 15;
6 | }
7 |
8 | fn futatu(ref i: i32)
9 | {
10 | i += 2;
11 | }
12 |
13 | fn main() i32
14 | {
15 | i: i32;
16 | hitotu(out i);
17 | futatu(ref i);
18 | return i - 17;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/rt/test/function/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn mittu(ref i: i32) i32
5 | {
6 | }
7 |
8 | fn main() i32
9 | {
10 | i: i32;
11 | mittu(i);
12 | return i;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/function/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn div(numerator: i32, denominator: i32) i32
4 | {
5 | return numerator / denominator;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return div(denominator:2, numerator:4) * div(numerator:3, denominator:1) - 6;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/function/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn div(numerator: i32, denominator: i32) i32
5 | {
6 | return numerator / denominator;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return div(denominator:2, 4);
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn div(numerator: i32, denominator:i32)
5 | {
6 | return numerator / denominator;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return div(denominatr:2, foo:4);
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/008/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn div(numerator: i32, denominator: i32) i32
5 | {
6 | return numerator / denominator;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return div(denominator:2, foo:4);
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/011/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn add(a: i32, b: i32 = 2) i32
4 | {
5 | return a + b;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return (add(12, 2) + add(12)) - 28;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/function/012/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn add(a: i32, b: i32 = 2) (i32)
4 | {
5 | return a + b;
6 | }
7 |
8 | i32 main()
9 | {
10 | return (add(12, 2) + add(12)) - 28;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/function/013/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn add(a: i32, b: i32 = 2) (i32, i64)
5 | {
6 | return a + b;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return add(12, 2) + add(12);
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/014/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn setA(ref a : i32) void
4 | {
5 | a = 2;
6 | }
7 |
8 | fn setB(out b : i32) void
9 | {
10 | b = 4;
11 | }
12 |
13 | i32 main()
14 | {
15 | c, d: i32;
16 | setA(ref c);
17 | setB(out d);
18 | return (c + d) - 6;
19 | }
20 |
--------------------------------------------------------------------------------
/rt/test/function/015/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn div(a : i32, b : i32) i32
4 | {
5 | return a / b;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return div(b:2, a:10) - 5;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/function/016/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | x: i32 = 12;
6 | fn getX() i32
7 | {
8 | return x;
9 | }
10 | return getX() - 12;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/function/017/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | int x = 0;
7 | global fn getX() i32
8 | {
9 | return x;
10 | }
11 | return getX();
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/019/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn setToTwo(ref x: i32)
4 | {
5 | x = 2;
6 | }
7 |
8 | fn main() i32
9 | {
10 | too: i32;
11 | setToTwo(ref too);
12 | return too - 2;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/function/020/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn getThree(i32) i32
4 | {
5 | return 3;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return getThree(17) - 3;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/function/021/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn getThree(ln : const size_t = __LINE__) i32
5 | {
6 | return 0;
7 | }
8 |
9 | fn main() i32
10 | {
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/022/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn doSomething();
4 |
5 | fn doSomethingElse()
6 | {
7 | }
8 |
9 | fn main() i32
10 | {
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/023/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class NumberHolder
4 | {
5 | i32 mNumber;
6 |
7 | this(number : i32)
8 | {
9 | mNumber = number;
10 | }
11 | }
12 |
13 | fn main() i32
14 | {
15 | nh := new NumberHolder(0);
16 | return nh.mNumber;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/function/024/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(in char*)
4 | {
5 | }
6 |
7 | fn bar(in id: char*)
8 | {
9 | }
10 |
11 | fn main() i32
12 | {
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/function/025/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class LoadedDice
4 | {
5 | num: i32;
6 |
7 | this(n: i32 = 2)
8 | {
9 | num = n;
10 | }
11 | }
12 |
13 | fn main() i32
14 | {
15 | dice := new LoadedDice();
16 | return dice.num - 2;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/function/026/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn multIntegers(i: i32, j: i32) i32
4 | {
5 | return i * j;
6 | }
7 |
8 | fn main() i32
9 | {
10 | fp: fn (i32, i32) i32 = multIntegers;
11 | return fp(3, 2) - 6;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/027/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn multIntegers(i: i32, j: i32) i32
4 | {
5 | return i * j;
6 | }
7 |
8 | fn main() i32
9 | {
10 | fp: fn!Volt (i32, i32) i32 = multIntegers;
11 | return fp(3, 2) - 6;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/function/030/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct ir {
4 | alias Foo = i32;
5 | }
6 |
7 | fn foo(ir.Foo)
8 | {
9 | }
10 |
11 | fn main() i32
12 | {
13 | foo(32);
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/function/034/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | import core.varargs;
5 |
6 | extern (C) fn sum(...)
7 | {
8 | }
9 |
10 | fn main() i32
11 | {
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/function/035/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import core.varargs;
4 |
5 | extern (C) fn printf(const(char)*, ...) i32;
6 |
7 | fn main() i32
8 | {
9 | return printf("%s\n".ptr, "ABC".ptr) - 4;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/function/038/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | import core.stdc.stdio;
5 |
6 | fn case1(dg: void delegate(string))
7 | {
8 | }
9 |
10 | fn main() i32
11 | {
12 | fn f1(s: char[]) {
13 | }
14 |
15 | case1(f1);
16 |
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/function/040/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn func(ref arg: i32[])
4 | {
5 | }
6 |
7 | fn main() i32
8 | {
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/function/041/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | @property fn foo(i32*)
5 | {
6 | }
7 |
8 | fn main() i32
9 | {
10 | p: void*;
11 | foo = p;
12 | return 0;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/function/044/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(ref x: i32)
4 | {
5 | x = 0;
6 | }
7 |
8 | fn main() i32
9 | {
10 | y: i32 = 12;
11 | foo(ref y);
12 | return y;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/function/045/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/rt/test/function/046/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | if (true) {
6 | return 0;
7 | }
8 | // Never reached.
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/rt/test/function/047/test.volt:
--------------------------------------------------------------------------------
1 | // A small exercise of ref.
2 | module test;
3 |
4 |
5 | fn addOne(ref i: i32)
6 | {
7 | base: i32 = i;
8 | i = base + 1;
9 | }
10 |
11 | fn main() i32
12 | {
13 | i: i32 = 29;
14 | addOne(ref i);
15 | return i - 30;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/function/048/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:cannot modify
3 | // Simple in param test.
4 | module test;
5 |
6 |
7 | fn foo(in foo: i32*)
8 | {
9 | *foo = 42;
10 | }
11 |
12 | fn main() i32
13 | {
14 | i: i32;
15 | foo(&i);
16 | return i - 42;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/function/049/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn foo(base: i32, ...) i32
5 | {
6 | return base + cast(int) _typeids[0].size + cast(int) _typeids[1].size;
7 | }
8 |
9 | fn main() i32
10 | {
11 | i: i32;
12 | s: i16;
13 | return foo(36, i, s) - 42;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/function/050/test.volt:
--------------------------------------------------------------------------------
1 | // @property assignment.
2 | module test;
3 |
4 |
5 | global mX: i32;
6 |
7 | @property fn x(_x: i32)
8 | {
9 | mX = _x;
10 | return;
11 | }
12 |
13 | fn main() i32
14 | {
15 | x = 42;
16 | return mX - 42;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/function/054/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(a: i32, b: i32 = 20) i32
4 | {
5 | return a + b;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return foo(3) - 23;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/function/056/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class aClass
4 | {
5 | this(ref i: i32)
6 | {
7 | i = 32;
8 | }
9 | }
10 |
11 | fn main() i32
12 | {
13 | i := 64;
14 | auto p = new aClass(ref i);
15 | return i - 32;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/integer/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | charVar: char;
7 |
8 | static is (typeof(charVar + charVar) == i32);
9 |
10 | return 0;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/integer/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | byteVar: i8;
8 | uintVar: u32;
9 |
10 | // mixing signed ness.
11 | var := byteVar + uintVar;
12 | return 0;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/integer/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | ubyteVar: u8 = 4;
7 | uintVar: u32 = 1;
8 |
9 | uintVar = uintVar << ubyteVar;
10 | uintVar = uintVar >> 2;
11 |
12 | return cast(i32)uintVar == 4 ? 0 : 1;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/integer/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | foo: bool;
7 | // Should not implicitly convert to a bool.
8 | foo = 0;
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/interface/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | interface IVuvuzela
5 | {
6 | fn annoy();
7 | }
8 |
9 | class RespectfulHumanBeing : IVuvuzela
10 | {
11 | }
12 |
13 | fn main() i32
14 | {
15 | return 3;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/rt/test/interface/006/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | interface Foo
5 | {
6 | fn func();
7 | }
8 |
9 | class Bar : Foo
10 | {
11 | override fn func() {}
12 | }
13 |
14 | fn main() i32
15 | {
16 | return 0;
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/rt/test/interface/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | interface Foo
4 | {
5 | fn func();
6 | }
7 |
8 | class Bar : Foo
9 | {
10 | override fn func() {}
11 | fn func(foo: i32) {}
12 | }
13 |
14 | fn main() i32
15 | {
16 | return 0;
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/rt/test/interface/013/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | interface IFace
4 | {
5 | fn foo(ref i: i32, j: i16);
6 | }
7 |
8 | fn bar(i: IFace)
9 | {
10 | x := 32;
11 | i.foo(ref x, 12);
12 | }
13 |
14 | fn main(args: string[]) i32
15 | {
16 | return 0;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/interface/deps/iface.volt:
--------------------------------------------------------------------------------
1 | module iface;
2 |
3 | interface IFace
4 | {
5 | fn getValue() i32;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/interface/deps/impl.volt:
--------------------------------------------------------------------------------
1 | module impl;
2 |
3 | import iface;
4 |
5 | class Impl : IFace
6 | {
7 | override fn getValue() i32
8 | {
9 | return 12;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/lexing/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | c: char = '\033';
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/lookup/001/test.volt:
--------------------------------------------------------------------------------
1 | // Ensures that test 2 isn't a fluke.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | if (true) {
8 | x: i32 = 0;
9 | return x;
10 | } else {
11 | x: i32 = 4;
12 | return x;
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/lookup/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | x: i32;
8 | if (true) {
9 | x: i32 = 3;
10 | return x;
11 | } else {
12 | x: i32 = 4;
13 | return x;
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/rt/test/lookup/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | // Ensure for declarations don't leak.
3 | module test;
4 |
5 |
6 | fn main() i32
7 | {
8 | for (x: i32 = 0; x < 10; x++) {}
9 | return x;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/lookup/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | class Foo
5 | {
6 | x: i32;
7 |
8 | this()
9 | {
10 | return;
11 | }
12 |
13 | fn func()
14 | {
15 | x: i32;
16 | return;
17 | }
18 | }
19 |
20 | fn main() i32
21 | {
22 | return 0;
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/rt/test/lookup/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct Foo
4 | {
5 | global fn foo() i32
6 | {
7 | return 7;
8 | }
9 | }
10 |
11 | fn foo() i32
12 | {
13 | return 12;
14 | }
15 |
16 | fn main() i32
17 | {
18 | return (Foo.foo() + foo()) - 19;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/rt/test/nested/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | x: i32;
6 | x = 2;
7 | fn func(y: i32) i32
8 | {
9 | return y * x;
10 | }
11 | return func(3) - 6;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/nested/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | fn func() i32 { return 0; }
6 | dgt: scope dg() i32 = func;
7 | return dgt();
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/nested/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | x: i32 = 3;
6 | fn func() i32 { return 12 + x; }
7 | return func() - 15;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/nested/005/test.volt:
--------------------------------------------------------------------------------
1 | // The nested transforms should not interfere with implicit casting.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | x: i64 = 4;
7 | fn func() i16 { return cast(i16)(12 + x); }
8 | return func() - 16;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/nested/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | x: i32;
6 | x = 2;
7 | fn func() i32
8 | {
9 | y: i32;
10 | if (x == 2) {
11 | y = 4;
12 | }
13 | return x * y;
14 | }
15 | return func() - 8;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/nested/009/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | fn foo() { return; }
6 | return typeid(foo).mangledName == typeid(scope dg()).mangledName ? 0 : 42;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/nested/014/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | ints: i32[];
6 | fn countToTen() i32
7 | {
8 | ints ~= countToTen();
9 | return 4;
10 | }
11 | return 0;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/nested/018/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class Foo
4 | {
5 | z: i32;
6 | fn writeMarkdownEscaped()
7 | {
8 | if (true) {
9 | ff := z;
10 | fn bar() {
11 | }
12 | }
13 | }
14 | }
15 |
16 | fn main() i32
17 | {
18 | return 0;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/rt/test/nested/022/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | fn func1() {}
7 | global fn func2() {}
8 |
9 | static is (typeof(func1) == scope dg());
10 | static is (typeof(func2) == fn());
11 |
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/overloading/004/test.volt:
--------------------------------------------------------------------------------
1 | // Ensure that overload erroring doesn't affect non overloaded functions.
2 | module test;
3 |
4 |
5 | fn foo() i32
6 | {
7 | return 0;
8 | }
9 |
10 | fn main() i32
11 | {
12 | func := foo;
13 | return func();
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/overloading/006/test.volt:
--------------------------------------------------------------------------------
1 | // Casting non-overloaded function.
2 | module test;
3 |
4 |
5 | fn foo() i32
6 | {
7 | return 0;
8 | }
9 |
10 | fn main() i32
11 | {
12 | func := cast(fn() i32) foo;
13 | return func();
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/overloading/022/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(a: i32[2]) i32
4 | {
5 | return a[0] + a[1];
6 | }
7 |
8 | fn foo(s: string) i32
9 | {
10 | return cast(i32)s.length;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return foo([19, 8]) - 27;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/overloading/024/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | interface Iface {}
4 | class Foo : Iface
5 | {
6 | this(Iface) {}
7 | }
8 |
9 | fn main() i32
10 | {
11 | foo: Foo;
12 |
13 | // Fails to implicitly convert to Iface.
14 | new Foo(foo);
15 |
16 | return 0;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/parsing/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | () @trusted {} ();
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/parsing/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn foo(...) i32
4 | {
5 | return 0;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return foo();
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/parsing/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | map: u32[immutable(u32)[]];
6 | return 0;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/protection/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() i32
8 | {
9 | return variable;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/protection/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() i32
8 | {
9 | return func();
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/protection/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() _alias
8 | {
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/protection/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() i32
8 | {
9 | return ENUM;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/protection/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() i32
8 | {
9 | s: _struct;
10 | return s.x;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/protection/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() i32
8 | {
9 | c := new _class();
10 | return c.x;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/protection/008/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | private global a: i32;
4 |
5 | fn main() i32
6 | {
7 | a = 0;
8 | return a;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/rt/test/protection/009/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S
4 | {
5 | private x: i32;
6 | }
7 |
8 | fn main() i32
9 | {
10 | s: S;
11 | return s.x;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/protection/010/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() i32
8 | {
9 | s: _struct2;
10 | return s.x;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/protection/011/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import a;
6 |
7 | fn main() i32
8 | {
9 | return NAMED.ENUM;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/protection/014/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class P
4 | {
5 | protected:
6 | fn foo() {}
7 | }
8 |
9 | class C : P
10 | {
11 | protected:
12 | override fn foo() {}
13 | }
14 |
15 | fn main() i32
16 | {
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/protection/019/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import a : palias;
5 |
6 | fn main() i32
7 | {
8 | pr := palias;
9 | return 0;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/protection/024/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | private alias fuzzy = size_t;
4 | private alias fozzy = fuzzy;
5 | global f: fuzzy;
6 | global g: fozzy;
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/protection/025/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:tried to access private symbol 'fuzzy'
3 | module test;
4 |
5 | import person;
6 |
7 | global f: fuzzy;
8 |
9 | fn main() i32
10 | {
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/protection/026/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | private alias fuzzy = size_t;
5 |
6 | import usepriv;
7 |
8 | fn main() i32
9 | {
10 | return cast(i32)f;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/protection/deps/person.volt:
--------------------------------------------------------------------------------
1 | module person;
2 |
3 | class Person
4 | {
5 | protected global fn getAge() i32
6 | {
7 | return 12;
8 | }
9 | }
10 |
11 | private alias fuzzy = size_t;
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/protection/deps/usepriv.volt:
--------------------------------------------------------------------------------
1 | module usepriv;
2 |
3 | global f: size_t;
4 |
--------------------------------------------------------------------------------
/rt/test/simple/001/test.volt:
--------------------------------------------------------------------------------
1 | // Most basic test.
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | return 0;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/simple/002/test.volt:
--------------------------------------------------------------------------------
1 | // Basic function test.
2 | module test;
3 |
4 |
5 | fn func() i32
6 | {
7 | return 0;
8 | }
9 |
10 | fn main() i32
11 | {
12 | return func();
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/rt/test/simple/003/test.volt:
--------------------------------------------------------------------------------
1 | // Local var test.
2 | module test;
3 |
4 |
5 | local var: i32;
6 |
7 | int main()
8 | {
9 | var = 32;
10 | return var == 32 ? 0 : 1;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/simple/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | s: i16;
7 | return s;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/simple/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | i := 42;
7 | return i == 42 ? 0 : 1;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/simple/006/test.volt:
--------------------------------------------------------------------------------
1 | // Tests TypeInfo lowering.
2 | module test;
3 |
4 | import core.typeinfo : TypeInfo;
5 |
6 |
7 | fn main() i32
8 | {
9 | tinfo: TypeInfo = typeid(i32);
10 | return (cast(i32)tinfo.size == 4) ? 0 : 1;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/simple/007/test.volt:
--------------------------------------------------------------------------------
1 | // Tests New Lowering
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | ip: i32* = new i32;
8 | *ip = 7;
9 | return *ip == 7 ? 0 : 1;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/rt/test/statement/alias/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:circular dependency detected
3 | // Alias circular dependency test.
4 | module test;
5 |
6 |
7 | alias foo = bar;
8 | alias bar = foo;
9 |
10 | fn main() i32
11 | {
12 | t: foo;
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/statement/assert/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | static is(i32 == i32);
8 | static is(i32 == char[]);
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/assert/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | static assert(true);
4 |
5 | fn main() i32
6 | {
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/statement/assert/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:balloon
3 | module test;
4 |
5 | static assert(false, "balloon");
6 |
7 | fn main() i32
8 | {
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/catch/003/test.volt:
--------------------------------------------------------------------------------
1 | //T requires:exceptions
2 | module test;
3 |
4 | import core.exception;
5 |
6 |
7 | fn main() i32
8 | {
9 | try {
10 | throw new Exception("hello");
11 | } catch (Exception e) {
12 | return 0;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/statement/for/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 |
4 | fn main() i32
5 | {
6 | // Segfaults the compiler
7 | // Just turn this into a while(true)
8 | for (;;) {
9 | return 0;
10 | }
11 | return 42;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/statement/for/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | for (i: u32; i < 4; i++) {
6 | }
7 | for (i: u32 = 2; i < 4; i++) {
8 | return cast(i32)i - 2;
9 | }
10 | return 2;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/for/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | ptr: u8* = new u8;
6 | for (s := *ptr; *ptr != 0; s++) {
7 | }
8 | return *ptr;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/foreach/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | i: i32;
6 | foreach (0 .. 8) {
7 | i++;
8 | }
9 | return i - 8;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/foreach/005/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | str: string = "hello";
6 | foreach (d: dchar; str) {
7 | }
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/if/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | if (a := 41) {
6 | return a - 41;
7 | }
8 | return 6;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/if/003/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | b := false;
6 | if (!false) {
7 | return 0;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m1;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m2;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar - 32;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import mod = m1;
5 |
6 |
7 | fn main() i32
8 | {
9 | return mod.exportedVar - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m1 : exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m1 : exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return otherVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/006/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m3;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/007/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m3 : exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/008/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m4;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/009/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m4 : exportedVar;
5 |
6 |
7 | int main()
8 | {
9 | return exportedVar - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/010/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m4 : otherVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/011/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m1, m2;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/012/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m1 : exportedVar1 = exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar1 - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/013/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m1 : exportedVar1 = exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/014/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import m1 : exportedVar1 = exportedVar;
5 | import m2 : exportedVar2 = exportedVar;
6 |
7 |
8 | fn main() i32
9 | {
10 | return exportedVar1 + exportedVar2 - 74;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/import/015/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import ctx = m1;
5 |
6 |
7 | fn main() i32
8 | {
9 | return ctx.exportedVar - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/016/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import ctx = m1;
5 |
6 |
7 | fn main() i32
8 | {
9 | return exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/017/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import ctx = m1 : exportedVar1 = exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return ctx.exportedVar1 - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/018/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import ctx = m1 : exportedVar1 = exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return ctx.exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/019/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import ctx = m1 : exportedVar1 = exportedVar;
5 |
6 |
7 | fn main() i32
8 | {
9 | return ctx.otherVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/020/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m3;
5 |
6 |
7 | fn main() i32
8 | {
9 | return m1.exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/021/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 |
5 | fn main() i32
6 | {
7 | size_t val = 4;
8 |
9 | return cast(int)val - 4;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/022/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 |
5 | fn func(str: string) i32
6 | {
7 | return cast(i32)str[5];
8 | }
9 |
10 | fn main() i32
11 | {
12 | str: string = "Hello World";
13 |
14 | return func(str) - 32;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/statement/import/023/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m6;
5 |
6 |
7 | fn main() i32
8 | {
9 | return m1.exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/024/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import m7;
5 |
6 |
7 | fn main() i32
8 | {
9 | return m6.m1.exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/025/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | // Non-public import rebind.
3 | module test;
4 |
5 | import m8;
6 |
7 |
8 | fn main() i32
9 | {
10 | return ctx.exportedVar;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/import/026/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | // Non-public import rebind.
3 | module test;
4 |
5 | import m9;
6 |
7 |
8 | fn main() i32
9 | {
10 | return exportedVar1;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/import/027/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | static import test2;
5 | static import foo.bar.baz;
6 |
7 | fn main() i32
8 | {
9 | test2.setX();
10 | return foo.bar.baz.x - 12;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/statement/import/028/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import ir = m12;
5 |
6 | fn main() i32
7 | {
8 | return cast(int) ir.retval - 41;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/029/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import e;
5 | import f;
6 |
7 | int main()
8 | {
9 | return cast(i32)x;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/030/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import g;
5 | import h;
6 |
7 | fn main() i32
8 | {
9 | return ii.x;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/031/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import bug_031_m1;
5 | import bug_031_m2;
6 |
7 |
8 | int main()
9 | {
10 | return func() - 42;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/import/032/test.volt:
--------------------------------------------------------------------------------
1 | fn main() i32
2 | {
3 | return 0;
4 | }
5 |
--------------------------------------------------------------------------------
/rt/test/statement/import/033/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import test.volt;
5 |
6 | fn main() i32
7 | {
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/034/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import mod1;
5 | import mod2;
6 |
7 | fn main() i32
8 | {
9 | return foo - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/035/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import mod1;
5 | import mod3;
6 |
7 | fn main() i32
8 | {
9 | return foo;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/036/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:access
3 | module test;
4 |
5 | import b36;
6 |
7 | fn main() i32
8 | {
9 | *pointer += 3;
10 | return *pointer - 7;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/import/037/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import a;
5 |
6 | fn main() i32
7 | {
8 | return b.exportedVar - 42;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/038/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | import a;
5 |
6 | fn main() i32
7 | {
8 | return exportedVar - 42;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/039/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn core() i32
4 | {
5 | return 0;
6 | }
7 |
8 | fn main() i32
9 | {
10 | return core();
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/import/040/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | static import core.object;
5 |
6 | fn core() i32
7 | {
8 | return 0;
9 | }
10 |
11 | fn main() i32
12 | {
13 | return core();
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/statement/import/041/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import core = m1;
5 |
6 | fn main() i32
7 | {
8 | return core.exportedVar - 42;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/042/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:redefine
3 | module test;
4 |
5 | import core = m1;
6 |
7 | fn core() i32
8 | {
9 | return 0;
10 | }
11 |
12 | fn main() i32
13 | {
14 | return core.exportedVar - 42;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/statement/import/043/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import foo.bar.baz;
5 | import foo = m1;
6 |
7 | fn main() i32
8 | {
9 | return foo.exportedVar - 42;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/044/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | module test;
3 |
4 | static import foo.bar.baz;
5 | import foo = m1;
6 |
7 | fn main() i32
8 | {
9 | return foo.exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/045/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import watt = [m1, m13];
5 |
6 | fn main() i32
7 | {
8 | return watt.exportedVar - (watt.retval + 1);
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/046/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import watt = [m1, m2];
5 |
6 | fn main() i32
7 | {
8 | return 0; // Error should occur on lookup.
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/047/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:multiple imports contain
3 | module test;
4 |
5 | import watt = [m1, m2];
6 |
7 | fn main() i32
8 | {
9 | return watt.exportedVar;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/048/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import watt = [m1, m14];
5 |
6 | fn main() i32
7 | {
8 | return watt.uniqueVar - 2; // Error should be on failed lookup, not mere presence of collisions.
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/049/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:may only be used in bind imports
3 | module test;
4 |
5 | import [m1, m14];
6 |
7 | fn main() i32
8 | {
9 | return uniqueVar - 2;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/050/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:multiple imports contain
3 | module test;
4 |
5 | import foo = [add1, add2];
6 |
7 | fn main() i32
8 | {
9 | return (foo.add(1, 2) + foo.add("aa", "bbb")) - 8;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/051/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:can't find module 'm34349'
3 | module test;
4 |
5 | import watt = [m1, m34349];
6 |
7 | fn main() i32
8 | {
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/052/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import letters = [b, c];
5 |
6 | fn main() i32
7 | {
8 | d: letters.D;
9 | return d;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/import/053/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | public import person53;
5 | import nine53;
6 |
7 | fn main() i32
8 | {
9 | return getNine() - 9;
10 | }
--------------------------------------------------------------------------------
/rt/test/statement/import/054/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:can't find module
3 | module test;
4 |
5 | import co.window;
6 |
7 | final class App {
8 | window: Window;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/README.txt:
--------------------------------------------------------------------------------
1 | Tests the import function of the language.
2 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/a.volt:
--------------------------------------------------------------------------------
1 | module a;
2 |
3 | public import b = m1;
4 |
5 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/a36.volt:
--------------------------------------------------------------------------------
1 | module a36;
2 |
3 | private global integer: i32;
4 |
5 | private global pPointer: i32*;
6 |
7 | alias pointer = pPointer;
8 |
9 | global this()
10 | {
11 | integer = 4;
12 | pPointer = &integer;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/add1.volt:
--------------------------------------------------------------------------------
1 | module add1;
2 |
3 | fn add(a: i32, b: i32) i32
4 | {
5 | return a + b;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/add2.volt:
--------------------------------------------------------------------------------
1 | module add2;
2 |
3 | fn add(a: string, b: string) i32
4 | {
5 | return cast(i32)a.length + cast(i32)b.length;
6 | }
7 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/b.volt:
--------------------------------------------------------------------------------
1 | module b;
2 |
3 | enum B = 2;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/b36.volt:
--------------------------------------------------------------------------------
1 | module b36;
2 | public import a36;
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/bug_031_m1.volt:
--------------------------------------------------------------------------------
1 | module bug_031_m1;
2 |
3 | public import bug_031_m3;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/bug_031_m2.volt:
--------------------------------------------------------------------------------
1 | module bug_031_m2;
2 |
3 | import bug_031_m3 : func;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/bug_031_m3.volt:
--------------------------------------------------------------------------------
1 | module bug_031_m3;
2 |
3 |
4 | fn func() i32
5 | {
6 | return 42;
7 | }
8 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/c.volt:
--------------------------------------------------------------------------------
1 | module c;
2 |
3 | enum C = 3;
4 | alias D = i32;
5 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/co/window.volt:
--------------------------------------------------------------------------------
1 | module display.co.window;
2 |
3 | import core.exception;
4 |
5 | class Window {
6 | fn initSdl() {
7 | throw new Exception("renderer does not support render-to-texture");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/e.volt:
--------------------------------------------------------------------------------
1 | module e;
2 |
3 | global x: i32;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/f.volt:
--------------------------------------------------------------------------------
1 | module f;
2 |
3 | global x: u64;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/foo/bar/baz.volt:
--------------------------------------------------------------------------------
1 | module foo.bar.baz;
2 |
3 | global x: i32;
4 |
5 | fn setX()
6 | {
7 | x = 12;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/g.volt:
--------------------------------------------------------------------------------
1 | module g;
2 |
3 | import ii = i;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/h.volt:
--------------------------------------------------------------------------------
1 | module h;
2 |
3 | import ii = i;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/i.volt:
--------------------------------------------------------------------------------
1 | module i;
2 |
3 | global x: i32;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m1.volt:
--------------------------------------------------------------------------------
1 | module m1;
2 |
3 | global exportedVar: i32 = 42;
4 | global otherVar: i32 = 4242;
5 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m12.volt:
--------------------------------------------------------------------------------
1 | module m12;
2 |
3 | public import m13;
4 |
5 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m13.volt:
--------------------------------------------------------------------------------
1 | module m13;
2 |
3 | global retval: i32 = 41;
4 |
5 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m14.volt:
--------------------------------------------------------------------------------
1 | module m14;
2 |
3 | global exportedVar: i32 = 32;
4 | global otherVar: i32 = 3232;
5 | global uniqueVar: i32 = 2;
6 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m2.volt:
--------------------------------------------------------------------------------
1 | module m2;
2 |
3 | global exportedVar: i32 = 32;
4 | global otherVar: i32 = 3232;
5 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m3.volt:
--------------------------------------------------------------------------------
1 | module m3;
2 |
3 | import m1;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m4.volt:
--------------------------------------------------------------------------------
1 | module m4;
2 |
3 | public import m1;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m5.volt:
--------------------------------------------------------------------------------
1 | module m5;
2 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m6.volt:
--------------------------------------------------------------------------------
1 | module m6;
2 |
3 | static public import m1;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m7.volt:
--------------------------------------------------------------------------------
1 | module m7;
2 |
3 | public static import m6;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m8.volt:
--------------------------------------------------------------------------------
1 | module m8;
2 |
3 | import ctx = m1;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/m9.volt:
--------------------------------------------------------------------------------
1 | module m9;
2 |
3 | import m1 : exportedVar1 = exportedVar;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/mod1.volt:
--------------------------------------------------------------------------------
1 | module mod1;
2 |
3 | enum foo = 42;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/mod2.volt:
--------------------------------------------------------------------------------
1 | module mod2;
2 |
3 | static import mod1;
4 |
5 | alias foo = mod1.foo;
6 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/mod3.volt:
--------------------------------------------------------------------------------
1 | module mod3;
2 |
3 | enum foo = 42;
4 |
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/nine53.volt:
--------------------------------------------------------------------------------
1 | module nine53;
2 |
3 | fn getNine() i32
4 | {
5 | return 9;
6 | }
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/person53.volt:
--------------------------------------------------------------------------------
1 | module person53;
2 |
3 | import nine53 : getNine;
--------------------------------------------------------------------------------
/rt/test/statement/import/deps/test2.volt:
--------------------------------------------------------------------------------
1 | module test2;
2 |
3 | static import foo.bar.baz;
4 |
5 | fn setX()
6 | {
7 | foo.bar.baz.setX();
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/statement/staticIf/simple/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | enum A = 32;
4 |
5 | fn a() i32
6 | {
7 | static if (A != 32) {
8 | return 3;
9 | } else {
10 | return 7;
11 | }
12 | }
13 |
14 | fn main() i32
15 | {
16 | return a() - 7;
17 | }
18 |
--------------------------------------------------------------------------------
/rt/test/statement/staticIf/simpleMainBlock/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | enum A = 32;
4 |
5 | fn a() i32
6 | {
7 | static if (A == 31+1) {
8 | return 7;
9 | }
10 | }
11 |
12 | fn main() i32
13 | {
14 | return a() - 7;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/statement/staticIf/simpleNoElse/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | enum A = 32;
4 |
5 | fn a() i32
6 | {
7 | static if (A == 31) {
8 | return 3;
9 | }
10 | return 7;
11 | }
12 |
13 | fn main() i32
14 | {
15 | return a() - 7;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/001/test.volt:
--------------------------------------------------------------------------------
1 | // Basic switch test.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | switch (2) {
7 | case 1:
8 | return 1;
9 | case 2:
10 | return 0;
11 | case 3:
12 | return 7;
13 | default:
14 | return 9;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | switch (2) {
7 | case 1:
8 | return 1;
9 | case 2:
10 | return 5;
11 | case 3:
12 | return 7;
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/003/test.volt:
--------------------------------------------------------------------------------
1 | // Final switches.
2 | module test;
3 |
4 | enum A
5 | {
6 | B, C, D
7 | }
8 |
9 | fn main() i32
10 | {
11 | final switch (A.B) {
12 | case A.B:
13 | return 0;
14 | case A.C:
15 | return 5;
16 | case A.D:
17 | return 7;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/005/test.volt:
--------------------------------------------------------------------------------
1 | // Multiple cases on one case statement.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | switch (2) {
7 | case 1, 2, 3:
8 | return 0;
9 | default:
10 | return 9;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/006/test.volt:
--------------------------------------------------------------------------------
1 | // Case range switch statement.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | switch (3) {
7 | case 1: .. case 3:
8 | return 0;
9 | default:
10 | return 9;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/008/test.volt:
--------------------------------------------------------------------------------
1 | // Default case.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | switch ("BANANA") {
7 | case "apple":
8 | return 1;
9 | case "banana":
10 | return 7;
11 | case "mango":
12 | return 9;
13 | default:
14 | return 0;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/009/test.volt:
--------------------------------------------------------------------------------
1 | // Switch goto.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | switch (3) {
7 | case 1:
8 | return 1;
9 | case 2:
10 | goto default;
11 | case 3:
12 | goto case 2;
13 | default:
14 | return 0;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/015/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn over(i: i32) i32
4 | {
5 | switch (i) {
6 | case 7:
7 | case 0: return 7;
8 | case 1: return 8;
9 | default: return 0;
10 | }
11 | }
12 |
13 | fn main() i32
14 | {
15 | return over(8000);
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/016/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class Foo
4 | {
5 | enum Bar
6 | {
7 | A,
8 | B,
9 | }
10 | }
11 |
12 | fn main() i32
13 | {
14 | switch (4) with (Foo) {
15 | case Bar.A: return 1;
16 | default: return 0;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/018/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | ret: i32 = 4;
6 |
7 | switch (3) {
8 | case 2:
9 | return 2;
10 | case 3: // This doesn't fall through as expected.
11 | default:
12 | ret = 0;
13 | }
14 | return ret;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/019/test.volt:
--------------------------------------------------------------------------------
1 | // Collisions test.
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | switch ("dst") {
7 | case "f32": return 2;
8 | default: return 0;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/020/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | switch("get") {
6 | case "get", "remove":
7 | return 0;
8 | default:
9 | return 4;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/026/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | enum StringEnum = "enum1";
4 |
5 | fn main() i32
6 | {
7 | str := "enum1";
8 | switch (str) {
9 | case StringEnum: return 0;
10 | default:
11 | }
12 | return 12;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/029/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | str := "hello";
7 | switch (str) {
8 | case "hello":
9 | return 1;
10 | case "hello":
11 | return 2;
12 | default:
13 | return 0;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/030/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | alias IA = immutable(void)[];
4 |
5 | fn main() i32
6 | {
7 | a := [1, 2, 3];
8 | b := cast(IA)a;
9 | bool[IA] c;
10 | c[cast(IA)b] = true;
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/031/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | str := [1, 2, 3];
7 | switch (str) {
8 | case [1, 2, 3]:
9 | return 1;
10 | case [1, 2, 3]:
11 | return 2;
12 | default:
13 | return 0;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/statement/switch/032/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | str := [1, 2, 3];
6 | switch (str) {
7 | case [1, 2, 3]:
8 | return 0;
9 | case [1, 2, 1]:
10 | return 2;
11 | default:
12 | return 1;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/statement/while/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | while (true) {
7 | return 0;
8 | break;
9 | }
10 | return 1;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/statement/with/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S {
4 | y: Y;
5 | }
6 |
7 | struct Y {
8 | x: i32;
9 | }
10 |
11 | fn main() i32
12 | {
13 | s: S;
14 | s.y.x = 7;
15 | with (s.y) {
16 | return x - 7;
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/rt/test/statement/with/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | class Foo
5 | {
6 | x: i32;
7 | }
8 |
9 | fn main() i32
10 | {
11 | with (new Foo()) {
12 | x = 2;
13 | }
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/template/002/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:syntax-only
2 | module test;
3 |
4 | struct Foo = mixin OneArg!i32;
5 | union Foo = mixin OneArgWithSigil!i32*;
6 | class Foo = mixin TwoArg!(i32, i16);
7 | fn Foo = mixin FunctionInstance!User[32];
8 |
9 |
--------------------------------------------------------------------------------
/rt/test/template/003/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:while parsing
3 | module test;
4 |
5 | struct Foo(T)
6 | {
7 | t: T;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/template/004/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:expected
3 | module test;
4 |
5 | struct Foo = mixin Bar!(Baz!i32);
6 |
7 |
--------------------------------------------------------------------------------
/rt/test/template/038/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct Foo!(K, V)
4 | {
5 | struct Elm
6 | {
7 | key: K;
8 | value: V;
9 | }
10 | }
11 |
12 | struct Instance = mixin Foo!(i32, i16);
13 |
14 | fn main() i32
15 | {
16 | d: Instance.Elm;
17 | return d.key;
18 | }
19 |
--------------------------------------------------------------------------------
/rt/test/template/046/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct Foo!(K, V)
4 | {
5 | static assert(true);
6 | }
7 |
8 | struct Instance = mixin Foo!(i32, i16);
9 | struct Instance2 = mixin Foo!(f32, f32);
10 |
11 | fn main() i32
12 | {
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/template/048/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct Foo!(K, V)
4 | {
5 | static assert(false, "banana");
6 | }
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/template/055/test.volt:
--------------------------------------------------------------------------------
1 | /*#D*/
2 | module test;
3 |
4 | struct Definition(T)
5 | {
6 | T x;
7 | }
8 |
9 | int main()
10 | {
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/template/056/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:parsing
3 | module test;
4 |
5 | struct Definition(T)
6 | {
7 | T x;
8 | }
9 |
10 | int main()
11 | {
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/template/057/test.volt:
--------------------------------------------------------------------------------
1 | /*#D*/
2 | module test;
3 |
4 | struct Definition(T)
5 | {
6 | T x;
7 | }
8 |
9 | alias Instance = Definition!i32;
10 |
11 | int main()
12 | {
13 | Instance i;
14 | return i.x;
15 | }
16 |
--------------------------------------------------------------------------------
/rt/test/template/058/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:parsing
3 | module test;
4 |
5 | struct Definition(T)
6 | {
7 | T x;
8 | }
9 |
10 | alias Instance = Definition!i32;
11 |
12 | int main()
13 | {
14 | Instance i;
15 | return i.x;
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/template/061/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S!(val: i32)
4 | {
5 | enum E = val + 1;
6 | }
7 |
8 | struct SS = mixin S!32;
9 |
10 | fn main() i32
11 | {
12 | return SS.E - 33;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/template/062/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct S!(T, val: T)
4 | {
5 | enum E = val / 2;
6 | }
7 |
8 | struct SS = mixin S!(i32, 32);
9 | struct SSS = mixin S!(u32, 34u);
10 |
11 | fn main() i32
12 | {
13 | return cast(i32)SSS.E - 17;
14 | }
15 |
--------------------------------------------------------------------------------
/rt/test/template/065/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | //T check:unidentified identifier
3 | module test;
4 |
5 |
6 | struct Instance = mixin StructDefinition!(i32);
7 |
8 | fn main() i32
9 | {
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/template/069/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module test;
3 |
4 | import am = allocmap;
5 |
6 | struct A = mixin am.AllocHashMap!(i32);
7 |
8 | fn main() i32
9 | {
10 | a: A;
11 | a.x = 32;
12 | return a.x - 32;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/template/deps/add.volt:
--------------------------------------------------------------------------------
1 | module add;
2 |
3 | private enum A = 25;
4 |
5 | import core.exception;
6 |
7 | fn adder!(T)(a: T, b: T) T
8 | {
9 | if (b == 230) {
10 | throw new Exception("wow, that was unlucky");
11 | }
12 | return a + b + A;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/template/deps/allocmap.volt:
--------------------------------------------------------------------------------
1 | module allocmap;
2 |
3 | struct AllocHashMap!(T)
4 | {
5 | x: T;
6 | }
--------------------------------------------------------------------------------
/rt/test/template/deps/contrived.volt:
--------------------------------------------------------------------------------
1 | module contrived;
2 |
3 | private enum V = 12;
4 |
5 | class Contrived!(T)
6 | {
7 | fn foo() T
8 | {
9 | return V;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/template/deps/eyeballs.volt:
--------------------------------------------------------------------------------
1 | module eyeballs;
2 |
3 | private enum V = 5;
4 |
5 | union Eyeballs!(T)
6 | {
7 | global a: T = V;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/template/deps/get.volt:
--------------------------------------------------------------------------------
1 | module get;
2 |
3 | private enum V = 10;
4 |
5 | public enum pubV = V;
6 |
7 | fn getV!(T)() T
8 | {
9 | return V;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/template/deps/person.volt:
--------------------------------------------------------------------------------
1 | module person;
2 |
3 | import core.exception;
4 |
5 | private enum A = 25;
6 |
7 | struct Person!(T)
8 | {
9 | val: T;
10 |
11 | fn foo() i32
12 | {
13 | return val + A;
14 | //throw new Exception("hello world");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rt/test/template/functionValue/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | fn getValue!(T, V: T)() T
4 | {
5 | return V;
6 | }
7 |
8 | fn getInteger = mixin getValue!(i32, 10);
9 |
10 | fn main() i32
11 | {
12 | return getInteger() - 10;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/template/parsing/storage/test.volt:
--------------------------------------------------------------------------------
1 | module main;
2 |
3 | struct Data!(T)
4 | {
5 | }
6 |
7 | struct IntegerData = mixin Data!(const(i32));
8 |
9 | fn main() i32
10 | {
11 | return 0;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/template/res/empty.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VoltLang/Volta/02da320c375a3d34b3a749cca3446fba22bb485b/rt/test/template/res/empty.txt
--------------------------------------------------------------------------------
/rt/test/template/simpleFunctionNoMixin/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module main;
3 |
4 | import add;
5 |
6 | fn integerAdder = adder!i32;
7 |
8 | fn main() i32
9 | {
10 | return integerAdder(15, 15) - 55;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/template/simpleMixinFunctionFailure/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:unidentified identifier 'Exception'
3 | module main;
4 |
5 | import add;
6 |
7 | fn integerAdder = mixin adder!i32;
8 |
9 | fn main() i32
10 | {
11 | return integerAdder(15, 15) - 55;
12 | }
13 |
--------------------------------------------------------------------------------
/rt/test/template/simpleNonMixin/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | module main;
3 |
4 | import person;
5 |
6 | struct IntegerPerson = Person!i32;
7 |
8 | fn main() i32
9 | {
10 | p: IntegerPerson;
11 | p.val = -25;
12 | return p.foo();
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/template/structStaticFunctionFail/test.volt.dis:
--------------------------------------------------------------------------------
1 | //T macro:import
2 | //T has-passed:no
3 | module main;
4 |
5 | import vec;
6 |
7 | fn main() i32
8 | {
9 | v := Vec3.create();
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/testing/001/test.volt:
--------------------------------------------------------------------------------
1 | //T requires:linux || osx
2 | //T requires:x86_64 && !x86
3 | module test;
4 |
5 | fn main() i32
6 | {
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/toplevel/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | global x: i32;
4 |
5 | global this()
6 | {
7 | x = 0;
8 | return;
9 | }
10 |
11 | global ~this()
12 | {
13 | x = 2;
14 | return;
15 | }
16 |
17 | fn main() i32
18 | {
19 | return x;
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/rt/test/toplevel/004/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | class Clazz
4 | {
5 | private this()
6 | {
7 | }
8 | }
9 |
10 | fn main() i32
11 | {
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/rt/test/toplevel/005/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:importfail
2 | //T check:test.volt:9:9: error: tried to access private symbol
3 | module test;
4 |
5 | import clazz;
6 |
7 | fn main() i32
8 | {
9 | c := new Clazz();
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/rt/test/toplevel/deps/clazz.volt:
--------------------------------------------------------------------------------
1 | module clazz;
2 |
3 | class Clazz
4 | {
5 | private this()
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/rt/test/type/delegate/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | dg1 := cast(dg()) null;
6 | dg2: dg();
7 | if (dg1 is null && dg2 is null) {
8 | return 0;
9 | }
10 | return 17;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/rt/test/type/storage/001/test.volt:
--------------------------------------------------------------------------------
1 | //T macro:expect-failure
2 | module test;
3 |
4 | fn main() i32
5 | {
6 | i: i32 = 12;
7 | ip: immutable(i32)* = &i;
8 | i = 6;
9 | return *ip - 6;
10 | }
11 |
--------------------------------------------------------------------------------
/rt/test/type/storage/002/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | i: i32 = 12;
6 | ip: const(i32)* = &i;
7 | i = 6;
8 | return *ip - 6;
9 | }
10 |
--------------------------------------------------------------------------------
/rt/test/type/string/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | fn main() i32
4 | {
5 | a: string = "hello";
6 | b: const(char)[] = "hello";
7 | return a == b ? 0 : 1;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rt/test/vrt/gc/001/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import vrt.gc.entry;
4 | import vrt.ext.stdc;
5 |
6 | fn main() i32
7 | {
8 | foreach (i; 0 .. 2552) {
9 | a := new u8;
10 | }
11 | return 0;
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/rt/test/vrt/gc/007/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | import vrt.ext.stdc;
4 | import vrt.gc.entry;
5 |
6 | class Greeter
7 | {
8 | }
9 |
10 | fn main() i32
11 | {
12 | greeter := new Greeter();
13 | vrt_gc_collect();
14 | return 0;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/rt/test/vrt/gc/012/test.volt:
--------------------------------------------------------------------------------
1 | module test;
2 |
3 | struct ShouldBeEightBytes
4 | {
5 | a: i32;
6 | b: i16;
7 | }
8 |
9 | fn main() i32
10 | {
11 | if (typeid(ShouldBeEightBytes).size != 8) {
12 | return 1;
13 | }
14 | return 0;
15 | }
16 |
17 |
--------------------------------------------------------------------------------