diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-27 01:39:29 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-01 01:04:06 +0100 |
| commit | 0c7b00977c8826b1cd172f7e90ad14e980190467 (patch) | |
| tree | 63fe9239a0f7f57b05a66595ee70025d06ed83db /validation/linear/builtin_isdigit.c | |
| parent | abfaa2dfb4d69eb0857d5af8ed082ccf8b824c46 (diff) | |
| download | sparse-dev-0c7b00977c8826b1cd172f7e90ad14e980190467.tar.gz | |
linearize __builtin_isdigit()
As an experiment about the linearization of builtins,
try this easy one (and statically expand it if the
argument is constant).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear/builtin_isdigit.c')
| -rw-r--r-- | validation/linear/builtin_isdigit.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/validation/linear/builtin_isdigit.c b/validation/linear/builtin_isdigit.c new file mode 100644 index 00000000..c1d3ea15 --- /dev/null +++ b/validation/linear/builtin_isdigit.c @@ -0,0 +1,12 @@ +_Bool isdigit(int c) +{ + return __builtin_isdigit(c) == (((unsigned) (c - '0')) <= 9); +} + +/* + * check-name: builtin_isdigit + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-returns: 1 + */ |
