Skip to content

Commit e4028e8

Browse files
Replace standardized checked declarations with #includes.
Automated and should not affect the behavior of the tests.
1 parent 5a862a9 commit e4028e8

File tree

89 files changed

+184
-342
lines changed

Some content is hidden

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

89 files changed

+184
-342
lines changed

clang/test/3C/3d-allocation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <stdio.h>
99
#include <stdlib.h>
1010

11-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11+
#include <stdlib.h>
1212

1313
int ***malloc3d(int y, int x, int z) {
1414
//CHECK_NOALL: int ***malloc3d(int y, int x, int z) : itype(_Ptr<int **>) {

clang/test/3C/add_bounds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void biz(){
3636
}
3737

3838
#include<stddef.h>
39-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
39+
#include <stdlib.h>
4040
_Array_ptr<int> faz(void) {
4141
//CHECK_ALL: _Array_ptr<int> faz(void) : count(100) {
4242
int *c = malloc(100 * sizeof(int));

clang/test/3C/alloc_type_param.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/alloc_type_param.c -- | diff %t.checked/alloc_type_param.c -
77

88
#include <stddef.h>
9-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
9+
#include <stdlib.h>
1210

1311
/* Check basic behavior with the three alloc functions */
1412
void foo() {

clang/test/3C/allocator.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
// expected-no-diagnostics
1111
//
1212
#include <stddef.h>
13-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
14-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
13+
#include <stdlib.h>
1514

1615
void dosomething(void) {
1716
int a = 0;

clang/test/3C/arrboundsbasic.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ Basic array bounds tests (without any data-flow analysis).
88

99
#include <stddef.h>
1010

11-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
12-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
13-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
14-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
11+
#include <stdlib.h>
1512

1613
struct bar {
1714
char *a;

clang/test/3C/arrboundsbasicinfer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Basic array bounds tests (without any data-flow analysis).
88

99
#include <stddef.h>
1010

11-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11+
#include <stdlib.h>
1212

1313
struct bar {
1414
char *a;

clang/test/3C/arrboundsbyte.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Array bounds (byte_bound) tests with data-flow analysis.
77
*/
88

99
#include <stddef.h>
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
10+
#include <stdlib.h>
1111
// This test needs a custom version of memcpy where src and dest are `int *`.
1212
int *memcpy_int(int *restrict dest
1313
: itype(restrict _Array_ptr<int>) byte_count(n),

clang/test/3C/arrboundsheuristics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
int *glob;
1212
int lenplusone;
1313
#include <stddef.h>
14-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
14+
#include <stdlib.h>
1515
//CHECK_ALL: _Array_ptr<int> glob = ((void *)0);
1616
//CHECK_NOALL: int *glob;
1717

clang/test/3C/arrboundsinfer2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Basic array bounds tests (without any data-flow analysis).
88

99
#include <stddef.h>
1010

11-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11+
#include <stdlib.h>
1212
extern void ext_func(_Array_ptr<int> arr : count(len), unsigned len);
1313

1414
struct bar {

clang/test/3C/arrctxsenbounds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Context-sensitive array-bounds inference.
77
*/
88
#include <stddef.h>
9-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
9+
#include <stdlib.h>
1010
struct foo {
1111
int *x;
1212
unsigned olol;

clang/test/3C/arrtests_xfail.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ Various array bounds tests.
99
*/
1010

1111
#include <stddef.h>
12-
void *memset(void *dest : byte_count(n), int c, size_t n) : bounds(dest, (_Array_ptr<char>)dest + n);
13-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
14-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12+
#include <string.h>
13+
#include <stdlib.h>
1514

1615
int *g; // array : count is 100; see the call to foo
1716
void foo(void) {

clang/test/3C/b_tests/b10_allsafepointerstruct.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b10_allsafepointerstruct.c -- | diff %t.checked/b10_allsafepointerstruct.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b11_calleestructnp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b11_calleestructnp.c -- | diff %t.checked/b11_calleestructnp.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b12_callerstructnp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b12_callerstructnp.c -- | diff %t.checked/b12_callerstructnp.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b13_calleestructp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b13_calleestructp.c -- | diff %t.checked/b13_calleestructp.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b14_callerstructp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b14_callerstructp.c -- | diff %t.checked/b14_callerstructp.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b15_calleepointerstruct.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b15_calleepointerstruct.c -- | diff %t.checked/b15_calleepointerstruct.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b16_callerpointerstruct.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b16_callerpointerstruct.c -- | diff %t.checked/b16_callerpointerstruct.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b17_bothstructnp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b17_bothstructnp.c -- | diff %t.checked/b17_bothstructnp.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b18_bothstructp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b18_bothstructp.c -- | diff %t.checked/b18_bothstructp.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b19_bothpointerstruct.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b19_bothpointerstruct.c -- | diff %t.checked/b19_bothpointerstruct.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b1_allsafe.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b1_allsafe.c -- | diff %t.checked/b1_allsafe.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
int *sus(int *x, int *y) {
1613
//CHECK_NOALL: _Ptr<int> sus(int *x : itype(_Ptr<int>), _Ptr<int> y) {

clang/test/3C/b_tests/b20_allsafepointerstructproto.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b20_allsafepointerstructproto.c -- | diff %t.checked/b20_allsafepointerstructproto.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b21_calleepointerstructproto.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b21_calleepointerstructproto.c -- | diff %t.checked/b21_calleepointerstructproto.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b22_callerpointerstructproto.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b22_callerpointerstructproto.c -- | diff %t.checked/b22_callerpointerstructproto.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
struct np {
1613
int x;

clang/test/3C/b_tests/b23_explicitunsafecast.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b23_explicitunsafecast.c -- | diff %t.checked/b23_explicitunsafecast.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
int *sus(int *x, int *y) {
1613
//CHECK_NOALL: _Ptr<int> sus(int *x : itype(_Ptr<int>), _Ptr<int> y) {

clang/test/3C/b_tests/b23_retswitchexplicit.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b23_retswitchexplicit.c -- | diff %t.checked/b23_retswitchexplicit.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
char *sus(int *x, int *y) {
1613
//CHECK_NOALL: char *sus(int *x : itype(_Ptr<int>), _Ptr<int> y) : itype(_Ptr<char>) {

clang/test/3C/b_tests/b24_implicitunsafecast.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/b24_implicitunsafecast.c -- | diff %t.checked/b24_implicitunsafecast.c -
77
#include <stddef.h>
8-
_Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
9-
_Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
10-
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
11-
_Itype_for_any(T) void *realloc(void *pointer : itype(_Array_ptr<T>) byte_count(1), size_t size) : itype(_Array_ptr<T>) byte_count(size);
12-
_Unchecked int printf(const char *restrict format : itype(restrict _Nt_array_ptr<const char>), ...);
13-
_Unchecked char *strcpy(char *restrict dest, const char *restrict src : itype(restrict _Nt_array_ptr<const char>));
8+
#include <stdlib.h>
9+
#include <stdio.h>
10+
#include <string.h>
1411

1512
int *sus(int *x, int *y) {
1613
//CHECK_NOALL: _Ptr<int> sus(int *x : itype(_Ptr<int>), _Ptr<int> y) {

0 commit comments

Comments
 (0)