Skip to content

Commit 1aad902

Browse files
Merge pull request diffblue#391 from diffblue/CBMC_merge_2018-04-25
[SEC-367] CBMC merge 2018-04-25
2 parents 6171f06 + 9ec8edd commit 1aad902

File tree

193 files changed

+2624
-924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+2624
-924
lines changed

cbmc/.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ NamespaceIndentation: None
8484
PenaltyBreakString: 10000
8585
PointerAlignment: Right
8686
ReflowComments: 'false'
87-
SortIncludes: 'false'
87+
SortIncludes: 'true'
8888
SpaceAfterCStyleCast: 'false'
8989
SpaceBeforeAssignmentOperators: 'true'
9090
SpaceBeforeParens: Never
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
struct some_struct
2+
{
3+
int some_field;
4+
} array[10];
5+
6+
int main()
7+
{
8+
array[0].some_field=1;
9+
array->some_field=1;
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#ifdef __GNUC__
2+
// example extracted from SV-COMP's ldv-linux-3.4-simple/
3+
// 32_7_cpp_false-unreach-call_single_drivers-net-phy-dp83640
4+
static int __attribute__((__section__(".init.text")))
5+
__attribute__((no_instrument_function)) dp83640_init(void)
6+
{
7+
return 0;
8+
}
9+
int init_module(void) __attribute__((alias("dp83640_init")));
10+
#endif
11+
12+
int main()
13+
{
14+
#ifdef __GNUC__
15+
dp83640_init();
16+
#endif
17+
return 0;
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

cbmc/regression/ansi-c/gcc_attributes9/main.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,23 @@ const char* __attribute__((section("s"))) __attribute__((weak)) bar();
1111
volatile int __attribute__((__section__(".init.data1"))) txt_heap_base1;
1212
volatile int __attribute__((__section__(".init.data3"))) txt_heap_base, __attribute__((__section__(".init.data4"))) txt_heap_size;
1313

14+
int __attribute__((__section__(".init.text"))) __attribute__((__cold__))
15+
__alloc_bootmem_huge_page(void *h);
16+
int __attribute__((__section__(".init.text"))) __attribute__((__cold__))
17+
alloc_bootmem_huge_page(void *h);
18+
int alloc_bootmem_huge_page(void *h)
19+
__attribute__((weak, alias("__alloc_bootmem_huge_page")));
20+
int __alloc_bootmem_huge_page(void *h)
21+
{
22+
return 1;
23+
}
1424
#endif
1525

1626
int main()
1727
{
1828
#ifdef __GNUC__
29+
int r = alloc_bootmem_huge_page(0);
30+
1931
static int __attribute__((section(".data.unlikely"))) __warned;
2032
__warned=1;
2133
return __warned;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
int bar()
2+
{
3+
return 0;
4+
}
5+
6+
int bar2()
7+
{
8+
return 0;
9+
}
10+
11+
int main()
12+
{
13+
unsigned x = foo();
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
void bar()
2+
{
3+
}
4+
5+
void bar2()
6+
{
7+
}
8+
9+
unsigned foo()
10+
{
11+
return 0;
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
main.c
3+
other.c
4+
^EXIT=(64|1)$
5+
^SIGNAL=0$
6+
^CONVERSION ERROR$
7+
error: conflicting function declarations `bar'
8+
error: conflicting function declarations `bar2'
9+
--
10+
^warning: ignoring
Binary file not shown.

0 commit comments

Comments
 (0)