summary refs log tree commit diff stats
path: root/tests/assign
Commit message (Collapse)AuthorAgeFilesLines
* use typeof instead type (#16962)flywind2021-02-081-1/+1
|
* followup for #16717: minimized example + improved comment (#16721)Timothee Cour2021-01-151-32/+44
|
* fix #16706 (#16717) [backport:1.4]flywind2021-01-141-0/+37
|
* use doAssert in tests (#16486)flywind2020-12-281-2/+2
|
* fix rtti sizeof for varargs in global scope (#13125) [backport]Jasper Jenkins2020-01-131-0/+9
|
* make tests green againAraq2019-05-271-4/+2
|
* require errormsg to be specified before file.Arne Döring2018-12-112-4/+1
|
* make tests green againAndreas Rumpf2018-10-131-4/+6
|
* Merge tests into a larger file (part 1 of ∞) (#9318)Miran2018-10-126-212/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * merge actiontable tests * merge arithm tests * merge array tests * merge assign tests * merge bind tests * merge casestmt tests * merge closure tests * merge cnt seq tests * merge collections tests * merge concept issues tests * merge concept tests * fix failing tests * smaller outputs Use `doAssert` where possible. * fix wrong output * split `tcomputedgoto` * revert merging concepts * fix failing test
* make tests green againAndreas Rumpf2018-07-051-2/+2
|
* make tests green againAndreas Rumpf2018-04-242-0/+2
|
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-044-34/+34
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* renamed writeln to writeLine in testspatrick dw2015-06-192-7/+7
|
* overloading of '=' worksAraq2015-04-063-0/+107
|
* Improves tobjasgn test.Dominik Picheta2014-04-181-6/+6
|
* Fixes #1005Dominik Picheta2014-04-151-5/+10
|
* new tester; all tests categorizedAraq2014-01-136-0/+165
specializeResetN(p, accessor, n[i], typ) of nkRecCase: if (n[0].kind != nkSym): internalError(p.config, n.info, "specializeResetN") let disc = n[0].sym if disc.loc.r == nil: fillObjectFields(p.module, typ) if disc.loc.t == nil: internalError(p.config, n.info, "specializeResetN()") lineF(p, cpsStmts, "switch ($1.$2) {$n", [accessor, disc.loc.r]) for i in 1..<n.len: let branch = n[i] assert branch.kind in {nkOfBranch, nkElse} if branch.kind == nkOfBranch: genCaseRange(p, branch) else: lineF(p, cpsStmts, "default:$n", []) specializeResetN(p, accessor, lastSon(branch), typ) lineF(p, cpsStmts, "break;$n", []) lineF(p, cpsStmts, "} $n", []) specializeResetT(p, "$1.$2" % [accessor, disc.loc.r], disc.loc.t) of nkSym: let field = n.sym if field.typ.kind == tyVoid: return if field.loc.r == nil: fillObjectFields(p.module, typ) if field.loc.t == nil: internalError(p.config, n.info, "specializeResetN()") specializeResetT(p, "$1.$2" % [accessor, field.loc.r], field.loc.t) else: internalError(p.config, n.info, "specializeResetN()") proc specializeResetT(p: BProc, accessor: Rope, typ: PType) = if typ == nil: return case typ.kind of tyGenericInst, tyGenericBody, tyTypeDesc, tyAlias, tyDistinct, tyInferred, tySink, tyOwned: specializeResetT(p, accessor, lastSon(typ)) of tyArray: let arraySize = lengthOrd(p.config, typ[0]) var i: TLoc getTemp(p, getSysType(p.module.g.graph, unknownLineInfo, tyInt), i) linefmt(p, cpsStmts, "for ($1 = 0; $1 < $2; $1++) {$n", [i.r, arraySize]) specializeResetT(p, ropecg(p.module, "$1[$2]", [accessor, i.r]), typ[1]) lineF(p, cpsStmts, "}$n", []) of tyObject: for i in 0..<typ.len: var x = typ[i] if x != nil: x = x.skipTypes(skipPtrs) specializeResetT(p, accessor.parentObj(p.module), x) if typ.n != nil: specializeResetN(p, accessor, typ.n, typ) of tyTuple: let typ = getUniqueType(typ) for i in 0..<typ.len: specializeResetT(p, ropecg(p.module, "$1.Field$2", [accessor, i]), typ[i]) of tyString, tyRef, tySequence: lineCg(p, cpsStmts, "#unsureAsgnRef((void**)&$1, NIM_NIL);$n", [accessor]) of tyProc: if typ.callConv == ccClosure: lineCg(p, cpsStmts, "#unsureAsgnRef((void**)&$1.ClE_0, NIM_NIL);$n", [accessor]) lineCg(p, cpsStmts, "$1.ClP_0 = NIM_NIL;$n", [accessor]) else: lineCg(p, cpsStmts, "$1 = NIM_NIL;$n", [accessor]) of tyChar, tyBool, tyEnum, tyInt..tyUInt64: lineCg(p, cpsStmts, "$1 = 0;$n", [accessor]) of tyCString, tyPointer, tyPtr, tyVar, tyLent: lineCg(p, cpsStmts, "$1 = NIM_NIL;$n", [accessor]) else: discard proc specializeReset(p: BProc, a: TLoc) = specializeResetT(p, rdLoc(a), a.t)