Skip to content

Commit c6f9231

Browse files
author
Daniel Kroening
authored
Merge pull request #2553 from tautschnig/always-inline-partial-revert
Partial revert of #1898 (always_inline support, second attempt)
2 parents fa94bc0 + e501317 commit c6f9231

File tree

34 files changed

+274
-133
lines changed

34 files changed

+274
-133
lines changed

regression/ansi-c/always_inline1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33

44
^EXIT=0$
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
static inline __attribute__((__always_inline__)) int func(int val)
2+
{
3+
return val;
4+
}
5+
6+
static inline int func2(int *p)
7+
{
8+
// the typecast, although redundant, is essential to show the problem
9+
return func(*(int*)p);
10+
}
11+
12+
int main()
13+
{
14+
int x;
15+
return func2(&x);
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE gcc-only
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
static inline __attribute__((__always_inline__)) int func(int val)
2+
{
3+
if(val > 0)
4+
return func(val - 1);
5+
return 0;
6+
}
7+
8+
int main()
9+
{
10+
int x;
11+
return func(x);
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE gcc-only
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extern int func_alias(int val) __asm__("" "func");
2+
3+
static inline __attribute__((__always_inline__)) int func(int val)
4+
{
5+
if(val > 0)
6+
return func_alias(val - 1);
7+
return 0;
8+
}
9+
10+
int main()
11+
{
12+
int x;
13+
return func(x);
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE gcc-only
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
static inline
2+
__attribute__((__section__(".init"))) __attribute__((__always_inline__))
3+
int func(int val)
4+
{
5+
return val + 1;
6+
}
7+
8+
int main()
9+
{
10+
int x;
11+
return func(x);
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE gcc-only
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
static inline __attribute__((__always_inline__)) int func(int val, ...)
2+
{
3+
return val + 1;
4+
}
5+
6+
int main()
7+
{
8+
int x;
9+
return func(x, x);
10+
}

0 commit comments

Comments
 (0)