Commit Graph

5670 Commits

Author SHA1 Message Date
gson 49a41610de Add a regression test for PR kern/52239, "Changing protections of
already mmap'ed region can fail", based on the test program in the PR.
2022-04-06 10:02:55 +00:00
rillig e6d4541762 tests/lint: add tests for a few early messages 2022-04-05 23:09:19 +00:00
gson 7109944a00 In the mmap_err test case, mmap the address, not the address of the address.
Should fix PR kern/56780.
2022-04-05 15:59:22 +00:00
gson fdc1a24341 When the t_mmap:mmap_err test fails due to errno not having the expected
value of EINVAL, print the actual value.
2022-04-05 13:09:54 +00:00
andvar e82c4d9bb4 fix various typos, mainly in comments. 2022-04-04 19:33:44 +00:00
rillig d0d6249954 lint: fix crash after syntax error in array declaration 2022-04-03 10:05:22 +00:00
rillig dc0c5ce6ac tests/lint: make a few tests self-contained, add some others 2022-04-03 09:34:45 +00:00
rillig bbec5f69b6 lint: fix crash after syntax error in GCC statement expression
Since cgram.y 1.226 from 2021-05-03.
2022-04-03 00:39:32 +00:00
rillig 4d0a0200e3 lint: remove unreachable message 'compiler takes alignment of function' 2022-04-02 21:47:04 +00:00
rillig 953cc1178c lint: try harder to recover after syntax errors
lint: assertion "false" failed in declarator_name at decl.c:1596
    near msg_022.c:22
2022-04-02 20:12:45 +00:00
rillig 7c13327109 lint: add type details to message about 'sizeof(function)'
The code in add_function is severely broken, it mixes up the return type
of the function with the argument types.  For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
2022-04-01 23:16:31 +00:00
rillig c902579041 lint: improve determination of abstract typename
Still not perfect, but at least a step in the right direction.  See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
2022-04-01 22:28:21 +00:00
rillig e5495b7249 lint: add details to message about illegal return type 2022-04-01 22:07:23 +00:00
rillig 96d2220fa5 tests/lint: fix comment about backslash-newline 2022-04-01 21:12:42 +00:00
rillig 614c592bd7 tests/lint2: add missing character in comment 2022-04-01 01:00:39 +00:00
yamaguchi 1c5c194e31 Add tests for MTU of lagg(4) 2022-03-31 03:26:33 +00:00
yamaguchi 9f8c3479a0 Added waiting for distributing state after attaching vlan
A lagg interface is reset on attaching vlan to enable
ETHERCAP_VLAN_MTU if the lagg I/F has it. Therefore,
it is necessary to wait for distributing.
2022-03-31 03:09:03 +00:00
christos 42c92eb5a7 remove zfs from the exception list; it now works like the other fs's. 2022-03-30 16:35:28 +00:00
christos 42f8118f95 update copyright. 2022-03-30 14:24:50 +00:00
christos 9d538b3985 skip userlevel filesystems that have their own rules (they depend on the
system setting of the sysctl on NetBSD) and zfs because it implements its
own rules for hardlinks to files (does its own permission checks).
2022-03-30 13:43:42 +00:00
christos f1d8378e1e ignore EOPNOTSUPP errors for fs's that don't support hard links. 2022-03-29 22:30:07 +00:00
christos 3c5909fb2a Add a test for hardlink sysctl limiting. 2022-03-28 20:51:04 +00:00
martin 37b043d21a Add sparc* to the list of architectures that need an explicit address
with PT_CONTINUE in this test.
2022-03-26 16:22:50 +00:00
riastradh 5901ceaa11 getrandom(2): Fix return value checks in automatic tests.
The syscall only guarantees up to 256 bytes in a single go -- if
interrupted, it might return short, but if the caller requested at
least 256 bytes it will definitely return 256 bytes.
2022-03-18 23:35:37 +00:00
rillig ca48e3c506 tests/lint: fix test about "non-portable character constant" on uchar
The warning is wrong, and it has been for a long time.  For now just fix
the test to match the actual output.  Seen on evbarm, which is one of
the platforms where a plain char is unsigned.

Noticed by Martin.
2022-03-14 20:25:26 +00:00
blymn f596e5447e Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.
2022-03-01 06:41:27 +00:00
rillig fddd84be4f tests/lint: add tests for messages about old-style functions 2022-02-27 20:02:43 +00:00
rillig ab0cea4ce1 lint: concatenate string literals from left to right
Previously, the string literals "1" "2" "3" "4" were concatenated in the
order "23", "234", "1234".  This influenced the location of the
diagnostics for traditional C (which doesn't know concatenation at all)
and for mixing regular strings and wide strings.

Now the diagnostics occur exactly where they are expected.  The first
string literal defines whether the whole string is regular or wide, and
any further string literals must match it.

In traditional C mode, there are more diagnostics than before, but that
doesn't hurt since they are still correct and nobody uses lint in
traditional C mode anyway.
2022-02-27 19:32:51 +00:00
rillig 6262bf18d3 tests/lint: test where exactly lint complains about concatenation
This only applies to traditional C and ensures that the behavior is
preserved when rearranging the C parser to evaluate string concatenation
from left to right.
2022-02-27 18:57:16 +00:00
rillig e970c8c0da tests/lint: demonstrate unexpected ordering of string concatenations
When lint concatenates the strings "1" "2" "3" "4", it first
concatenates "23", then "234" and finally "1234".
2022-02-27 18:51:21 +00:00
rillig a5dc812cd9 tests/lint: add tests for messages referring to C99 2022-02-27 12:00:27 +00:00
rillig 0a781eec83 lint: C99 has been released, so refer to it by its proper name 2022-02-27 11:40:29 +00:00
rillig fa4dd0e745 lint: encode lifetime of allocated memory in the function names
No functional change.
2022-02-27 08:31:26 +00:00
rillig 1887ef10af lint: fix memory corruption in statement expressions (since 2021-12-17)
The commit that introduced the assertion failure looks innocent, it only
adds a few predefined functions for GCC mode.  Nevertheless, before that
commit, lint consistently complained about 'error: void type illegal in
expression [109]', which doesn't make sense either.

This fix also removes the creative use of the initialization stack to
store the type of the statement expression.  Having a separate stack for
these statement expressions makes the code easier to understand.
2022-02-26 20:36:11 +00:00
rillig 292c0f5964 tests/lint: demonstrate assertion failure in GCC compound expression 2022-02-26 16:43:20 +00:00
gson cfc4b6e400 Mark randomly failing test cases as expected failures with a reference
to PR bin/56506.
2022-02-26 16:21:59 +00:00
rillig d6ea25cda3 tests/lint: sync tests for platform-dependent character comparisons 2022-02-26 11:13:01 +00:00
thorpej f92afe1eb4 Validate basic fcntl(2) behavior for eventfd and timerfd. 2022-02-20 15:21:14 +00:00
rillig 32b7a7ce5c tests/indent: test token '('
There are already some tests in token_lparen.c that need to be merged.
2022-02-13 12:04:37 +00:00
rillig dc5fc49783 tests/indent: demonstrate the poor handling of compound literals 2022-02-13 11:07:48 +00:00
rillig 74bde70120 indent: fix indentation of enum constants in typedef (since 2019-04-04)
The solution is not elegant since it adds a small state machine inside
the parser state, but at least these states only depend on the sequence
of token types and not on any other part of the parser state.

Reported in PR#55453.
2022-02-12 19:56:52 +00:00
rillig 3f3aed2ecb tests/indent: add another test for indentation of enum constants
To prevent an overzealous quick hack for indenting enum constants in a
typedef, as part of fixing PR#55453.
2022-02-12 19:46:56 +00:00
rillig 3bb21ee83b tests/indent: demonstrate wrong formatting of enum (since 2019-04-04)
Reported by me in PR#55453.
2022-02-12 13:38:29 +00:00
rillig 08650bcabe tests/lint: document where some C99 tests come from
These tests were added due to PR#45417.
2022-02-12 01:23:44 +00:00
rillig a3b73aeb65 lint: reword message about bit-field in a union
There is nothing illegal about a bit-field in a union, it is allowed by
C90, C99 and C11.

Fixes PR toolchain/53219.
2022-02-07 02:44:49 +00:00
rillig cdc3b2d88e tests/lint: add test for message 41 about bit-field in union
See PR toolchain/53219.
2022-02-07 02:39:10 +00:00
martin 0df09db48c Test mkdir(2) with one or more trailing slashes - this currently fails
for v7fs.
2022-02-01 18:27:24 +00:00
ryo aa60659cfa Extend the time to wait for the thread to quit.
It seems that alarm(1) is not enough time for the thread to actually exit after quittingtime = 1.
It randomly failed with "Test program received signal 14" on a slow environment.
2022-01-31 17:23:37 +00:00
andvar 7c674e8e6e remove double t from targeted, add missing r to arbitrary
And fix few more typos along the way in comments and man pages.
2022-01-26 11:48:53 +00:00
blymn b98cb8fe3d Remove excess shift since locale is no longer passed 2022-01-25 21:28:49 +00:00