diff options
Diffstat (limited to 'validation/backend')
| -rw-r--r-- | validation/backend/load-global.c | 21 | ||||
| -rw-r--r-- | validation/backend/string-value.c | 21 |
2 files changed, 42 insertions, 0 deletions
diff --git a/validation/backend/load-global.c b/validation/backend/load-global.c new file mode 100644 index 00000000..dedb35f3 --- /dev/null +++ b/validation/backend/load-global.c @@ -0,0 +1,21 @@ +const char *s = "abc"; +int x = 4; +int y; + +int *p = &x; +int *q; + +int loadn(void) { return y; } +int loadi(void) { return x; } + +const char *loads(void) { return s; } + +int *retpn(void) { return q; } +int loadpn(void) { return *q; } +int *retpi(void) { return p; } +int loadpi(void) { return *p; } + +/* + * check-name: use simple value from global vars + * check-command: ./sparsec -Wno-decl -c $file -o tmp.o + */ diff --git a/validation/backend/string-value.c b/validation/backend/string-value.c new file mode 100644 index 00000000..8cdec4a2 --- /dev/null +++ b/validation/backend/string-value.c @@ -0,0 +1,21 @@ +extern void use(const char *); + +const char *ret(void) +{ + return "abc"; +} + +const char *add(void) +{ + return "def" + 1; +} + +void call(void) +{ + use("ijk"); +} + +/* + * check-name: string-value + * check-command: ./sparsec -Wno-decl -c $file -o tmp.o + */ |
