Skip to content

Commit 6b6c8d3

Browse files
authored
Merge pull request #7584 from tautschnig/features/asm-renaming-type-conflict
C front-end: tolerate type differences with asm renaming
2 parents 22d25d1 + f6fd739 commit 6b6c8d3

File tree

11 files changed

+104
-24
lines changed

11 files changed

+104
-24
lines changed

regression/ansi-c/asm4/main.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// from Fedora's glibc
2+
struct dirent
3+
{
4+
int dummy;
5+
};
6+
7+
struct dirent64
8+
{
9+
int dummy;
10+
};
11+
12+
#ifdef __GNUC__
13+
extern struct dirent *readdir(void *__dirp) __asm__(
14+
""
15+
"readdir64");
16+
extern struct dirent64 *readdir64(void *__dirp);
17+
#endif
18+
19+
int main()
20+
{
21+
#ifdef __GNUC__
22+
int x;
23+
(void)readdir(&x);
24+
#endif
25+
return 0;
26+
}

regression/ansi-c/asm4/test.desc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE test-c++-front-end
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

regression/cbmc-library/sscanf-01/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
int main()
55
{
6-
sscanf();
7-
assert(0);
6+
char dest[10];
7+
int result = sscanf("hello", "%s", dest);
8+
assert(result == 1);
89
return 0;
910
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
KNOWNBUG
1+
CORE
22
main.c
3-
--pointer-check --bounds-check
4-
^EXIT=0$
3+
4+
^\[main.assertion.1\] line 8 assertion result == 1: FAILURE$
5+
^\*\* 1 of \d+ failed
6+
^VERIFICATION FAILED$
7+
^EXIT=10$
58
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
79
--
810
^warning: ignoring
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
#include <assert.h>
2+
#include <stdarg.h>
23
#include <stdio.h>
34

5+
int xscanf(const char *format, ...)
6+
{
7+
va_list list;
8+
va_start(list, format);
9+
int result = vfscanf(stdin, format, list);
10+
va_end(list);
11+
return result;
12+
}
13+
414
int main()
515
{
6-
vfscanf();
7-
assert(0);
16+
char dest[10];
17+
int result = xscanf("%s", dest);
18+
assert(result == 1);
819
return 0;
920
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
KNOWNBUG
1+
CORE
22
main.c
3-
--pointer-check --bounds-check
4-
^EXIT=0$
3+
4+
^\[main.assertion.1\] line 18 assertion result == 1: FAILURE$
5+
^\*\* 1 of \d+ failed
6+
^VERIFICATION FAILED$
7+
^EXIT=10$
58
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
79
--
810
^warning: ignoring
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
#include <assert.h>
2+
#include <stdarg.h>
23
#include <stdio.h>
34

5+
int xscanf(const char *format, ...)
6+
{
7+
va_list list;
8+
va_start(list, format);
9+
int result = vscanf(format, list);
10+
va_end(list);
11+
return result;
12+
}
13+
414
int main()
515
{
6-
vscanf();
7-
assert(0);
16+
char dest[10];
17+
int result = xscanf("%s", dest);
18+
assert(result == 1);
819
return 0;
920
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
KNOWNBUG
1+
CORE
22
main.c
3-
--pointer-check --bounds-check
4-
^EXIT=0$
3+
4+
^\[main.assertion.1\] line 18 assertion result == 1: FAILURE$
5+
^\*\* 1 of \d+ failed
6+
^VERIFICATION FAILED$
7+
^EXIT=10$
58
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
79
--
810
^warning: ignoring
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
#include <assert.h>
2+
#include <stdarg.h>
23
#include <stdio.h>
34

5+
int xscanf(const char *format, ...)
6+
{
7+
va_list list;
8+
va_start(list, format);
9+
int result = vsscanf("hello", format, list);
10+
va_end(list);
11+
return result;
12+
}
13+
414
int main()
515
{
6-
vsscanf();
7-
assert(0);
16+
char dest[10];
17+
int result = xscanf("%s", dest);
18+
assert(result == 1);
819
return 0;
920
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
KNOWNBUG
1+
CORE
22
main.c
3-
--pointer-check --bounds-check
4-
^EXIT=0$
3+
4+
^\[main.assertion.1\] line 18 assertion result == 1: FAILURE$
5+
^\*\* 1 of \d+ failed
6+
^VERIFICATION FAILED$
7+
^EXIT=10$
58
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
79
--
810
^warning: ignoring

0 commit comments

Comments
 (0)