db/fixup_kernel.sh: fix clear_user() handling
[smatch.git] / validation / call-inlined.c
bloba6cb4b5b097670dd6cbb6cfe26fcfa520340e936
1 static const char messg[] = "def";
3 static inline int add(int a, int b)
5 return a + b;
8 int foo(int a, int b) { return add(a + b, 1); }
9 void bar(int a, int b) { add(a + b, 1); }
12 static inline const char *lstrip(const char *str)
14 return str + 1;
17 const char *bas(void) { return lstrip("abc"); }
18 const char *qus(void) { return lstrip(messg); }
21 * check-name: call-inlined
22 * check-command: test-linearize -Wno-decl -m64 $file
23 * check-assert: sizeof(void*) == 8
25 * check-output-start
26 foo:
27 .L0:
28 <entry-point>
29 add.32 %r3 <- %arg1, %arg2
30 add.32 %r5 <- %r3, $1
31 # call %r6 <- add, %r3, $1
32 ret.32 %r5
35 bar:
36 .L3:
37 <entry-point>
38 # call %r13 <- add, %r10, $1
39 ret
42 bas:
43 .L6:
44 <entry-point>
45 add.64 %r16 <- "abc", $1
46 # call %r17 <- lstrip, %r14
47 ret.64 %r16
50 qus:
51 .L9:
52 <entry-point>
53 add.64 %r21 <- messg, $1
54 # call %r22 <- lstrip, %r19
55 ret.64 %r21
58 * check-output-end