1 static const char messg[] = "def";
2
add(int a,int b)3 static inline int add(int a, int b)
4 {
5 return a + b;
6 }
7
foo(int a,int b)8 int foo(int a, int b) { return add(a + b, 1); }
bar(int a,int b)9 void bar(int a, int b) { add(a + b, 1); }
10
11
lstrip(const char * str)12 static inline const char *lstrip(const char *str)
13 {
14 return str + 1;
15 }
16
bas(void)17 const char *bas(void) { return lstrip("abc"); }
qus(void)18 const char *qus(void) { return lstrip(messg); }
19
20 /*
21 * check-name: call-inlined
22 * check-command: test-linearize -Wno-decl -m64 $file
23 * check-assert: sizeof(void*) == 8
24 *
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
33
34
35 bar:
36 .L3:
37 <entry-point>
38 # call %r13 <- add, %r10, $1
39 ret
40
41
42 bas:
43 .L6:
44 <entry-point>
45 add.64 %r16 <- "abc", $1
46 # call %r17 <- lstrip, %r14
47 ret.64 %r16
48
49
50 qus:
51 .L9:
52 <entry-point>
53 add.64 %r21 <- messg, $1
54 # call %r22 <- lstrip, %r19
55 ret.64 %r21
56
57
58 * check-output-end
59 */
60