diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-03-19 00:33:15 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-11-16 20:37:00 +0100 |
| commit | c0428dfe31645d775003a83f66b67ee5d4aa83f6 (patch) | |
| tree | e1c4acb6778487c768415c4f02d6516753aadc31 /validation | |
| parent | 1bd55a66066a2c0ad49237311863d77052f84602 (diff) | |
| download | sparse-dev-c0428dfe31645d775003a83f66b67ee5d4aa83f6.tar.gz | |
fix usage of inlined calls
OP_INLINED_CALL are there only as a sort of annotation
for debugging purpose. It is thus wrong to associate
pseudo's usage to them (even if the pseudo are the arguments
of the function now inlined).
Fix this by removing the use_pseudo() for each arguments.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/call-inlined.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/validation/call-inlined.c b/validation/call-inlined.c new file mode 100644 index 00000000..6fd94edc --- /dev/null +++ b/validation/call-inlined.c @@ -0,0 +1,58 @@ +static const char messg[] = "def"; + +static inline int add(int a, int b) +{ + return a + b; +} + +int foo(int a, int b) { return add(a + b, 1); } +void bar(int a, int b) { add(a + b, 1); } + + +static inline const char *lstrip(const char *str) +{ + return str + 1; +} + +const char *bas(void) { return lstrip("abc"); } +const char *qus(void) { return lstrip(messg); } + +/* + * check-name: call-inlined + * check-command: test-linearize -Wno-decl $file + * + * check-output-start +foo: +.L0: + <entry-point> + add.32 %r3 <- %arg1, %arg2 + add.32 %r5 <- %r3, $1 + # call %r5 <- add, %r3, $1 + ret.32 %r5 + + +bar: +.L3: + <entry-point> + # call %r12 <- add, %r10, $1 + ret + + +bas: +.L6: + <entry-point> + add.64 %r16 <- "abc", $1 + # call %r16 <- lstrip, %r14 + ret.64 %r16 + + +qus: +.L9: + <entry-point> + add.64 %r21 <- messg, $1 + # call %r21 <- lstrip, %r19 + ret.64 %r21 + + + * check-output-end + */ |
