more-tests-and-corner-cases #72
Reference in New Issue
Block a user
Delete Branch "more-tests-and-corner-cases"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Just a bunch of tests covering corner cases and bugfixes for them.
A type was flattened word by word, a struct's body included, so (* (struct ((c int)))) came out struct c{ int; } *.{} is C23's. #() is all zeros, which C11 spells {0}, whatever it initializes.Request changes at
acbd492. Built with CHICKEN 6.0.0. The second./sex-testspassed.sextestpassed all 26 programs intests/sex-programs.check-modules,check-exit-code, andcheck-command-linepassed.Two of the new checks let a program through and hand
cc -std=c11 -pedantic-errorssomething it rejects.check-capture-namescompares each capture with the parameters, and with avarat the top of the body. The comment says no two are alike. Two captures are not in that comparison. Inside a function,comes out as a capture struct with two members
n, a localint ntwice, andƛ0_outer_make (int n, int n). gcc reports a duplicate member and a redefinition of the parameter. sexc exits with gcc's status.-9223372036854775808is the minimumlong long, and the decimal is not a C literal. The signed ranks keep a value whenabsis below2^63. This one's absolute value is2^63, so it has no type:(var x _ -9223372036854775808)iscannot infer the type of. Written out as(long long), the C islong long x = -9223372036854775808;. Under-std=c11 -pedantic-errorsthat constant is unsigned, and the negation is not the minimum. A positive past2^63-1is given auand compiles. This one sits in the signed range.The first
./sex-testsfailedholds no directiveintests/line-directives.scm. The marker123also occurs in the path fromcreate-temporary-directory, and that path is in every#line. A second run passed. The assertion and the temporary directory are older than this branch.A toplevel macro that raises is dropped while a module's interface is read. An importer of a file whose
(boom)calls(error "nope")still compiles, and still sees the otherpubforms. Compiling that file itself reportsexpanding boom: nope. The comment says a call that cannot expand gives importers nothing; an error takes the same path.Fixed at
724f4dd:28aaaf6refuses two captures of one name.a2bbb73reads-9223372036854775808as-9223372036854775807 - 1, typedlong long;c11.sexnow holds it under-pedantic-errors.d890080finds the conditional bymvar < 123…: 125, which no path holds.724f4dd: lookups report the names they miss; an interface-time macro call that fails is dropped only when it asked after a name its own module declares.(boom)now fails for importers too (tests/modules/gen/broken.sex).Approved at
724f4dd.make checkpassed on CHICKEN 6.0.0: the unit tests, all 26 programs intests/sex-programs,check-modules,check-exit-code, andcheck-command-line.The holes from last time are closed. Two captures of one name, including
(a (a 1)), are refused before any C is written.-9223372036854775808and-0x8000000000000000are bothlong long n = -9223372036854775807 - 1, which-std=c11 -pedantic-errorsaccepts, and the value is the minimum.holds no directivelooks formvar < 123and: 125, and passed. An importer of a module whose(boom)raises is toldexpanding boom: nope. A call that fails after asking for a name the module itself declares still gives the interface nothing, and the module's own compile is where that one is checked.@@ -53,3 +56,3 @@;;; A type variable is a mutable cell. `ref' is #f while unsolved and;;; the type it stands for once bound -- union-find, with the path;;; compression done in `resolve'.;;; compression done in `resolve'. `quals' are the ones written on it --Uh... Rebase artifact?