diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-03-01 18:15:08 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-03-01 18:15:08 +0100 |
| commit | acc5c29877eff97d2c8dec9319d27f9dcb699a69 (patch) | |
| tree | 3424310a89671e2ee27dd75554435c78f3ee0b71 /validation | |
| parent | ba404d63c70f00102dbe46dcc95e91c8c9755699 (diff) | |
| parent | 567dfd4f41d732043876dadc0697ba3b540066da (diff) | |
| download | sparse-dev-acc5c29877eff97d2c8dec9319d27f9dcb699a69.tar.gz | |
Merge branch 'fix-restrict' into next
* fix the type in the assignment of 0 to a restricted variable
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/eval/assign-restricted-ok.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/validation/eval/assign-restricted-ok.c b/validation/eval/assign-restricted-ok.c new file mode 100644 index 00000000..df94d8c9 --- /dev/null +++ b/validation/eval/assign-restricted-ok.c @@ -0,0 +1,22 @@ +#ifdef __CHECKER__ +#define __bitwise __attribute__((bitwise)) +#else +#define __bitwise +#endif + +typedef __INT16_TYPE__ __bitwise __be16; + +static __be16 foo(void) +{ + __be16 val = 0; + return val; +} + +/* + * check-name: assign-restricted-ok + * check-command: test-linearize -fdump-ir $file + * + * check-output-ignore + * check-output-contains: store\\.16 + * check-output-excludes: store\\.32 + */ |
