Skip to content

Commit 22e3c62

Browse files
committed
Clean up test based on feedback
1 parent 72d5f2e commit 22e3c62

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

clang/test/Analysis/element-region-address-space.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clang_analyze_cc1 -triple amdgcn-unknown-unknown \
2-
// RUN: -analyzer-checker=core,unix -verify %s
2+
// RUN: -Wno-incompatible-library-redeclaration \
3+
// RUN: -analyzer-checker=core,unix.cstring.BadSizeArg -verify %s
34

45
// expected-no-diagnostics
56
//
@@ -17,10 +18,10 @@ memcpy(ADDRESS_SPACE_64BITS void *,
1718
ADDRESS_SPACE_32BITS const void *,
1819
long unsigned int);
1920

20-
typedef struct {
21-
char m[1];
22-
} k;
21+
ADDRESS_SPACE_64BITS struct {
22+
char m[16];
23+
} n;
2324

24-
void l(ADDRESS_SPACE_32BITS char *p, ADDRESS_SPACE_64BITS k *n) {
25-
memcpy(&n->m[0], p, 4);
25+
void avoid_cstring_checker_crash(ADDRESS_SPACE_32BITS char *p) {
26+
memcpy(&n.m[0], p, 4); // no-crash
2627
}

0 commit comments

Comments
 (0)