Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Commit 8cbee8f

Browse files
authored
Add test for a NoStoreFuncVisitor bug. (#690)
1 parent a649a1f commit 8cbee8f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/Analysis/ctu-main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@ void testMacro(void) {
4545
g(0); // expected-warning@Inputs/ctu-other.c:29 {{Access to field 'a' results in a dereference of a null pointer (loaded from variable 'ctx')}}
4646
}
4747

48+
void h(int);
49+
4850
// The external function prototype is incomplete.
4951
// warning:implicit functions are prohibited by c99
5052
void testImplicit() {
51-
int res = identImplicit(6); // external implicit functions are not inlined
53+
int res = identImplicit(6);
5254
clang_analyzer_eval(res == 6); // expected-warning{{TRUE}}
55+
56+
// Call something with uninitialized from the same function in which the implicit was called.
57+
// This is necessary to reproduce a special bug in NoStoreFuncVisitor.
58+
int uninitialized;
59+
h(uninitialized); // [email protected]:59 {{1st function call argument is an uninitialized value}}
5360
}
5461

5562
// Tests the import of functions that have a struct parameter

0 commit comments

Comments
 (0)