Skip to content

Test sync with BigRefactor_master #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/test/CheckedCRewriter/alloc_type_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: cconv-standalone -alltypes %S/alloc_type_param.checked.c -- | count 0
// RUN: rm %S/alloc_type_param.checked.c

typedef unsigned long size_t;
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
extern _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);
Expand Down
13 changes: 6 additions & 7 deletions clang/test/CheckedCRewriter/arrboth.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ through invalid pointer arithmetic, an unsafe cast, etc.*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -109,7 +108,7 @@ x = (int *) 5;
//CHECK: x = (int *) 5;
int *z = calloc(5, sizeof(int));
//CHECK_NOALL: int *z = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
int i, fac;
int *p;
//CHECK_NOALL: int *p;
Expand All @@ -127,10 +126,10 @@ int * foo() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }

int * bar() {
Expand All @@ -139,9 +138,9 @@ int * bar() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
z += 2;
return z; }
11 changes: 5 additions & 6 deletions clang/test/CheckedCRewriter/arrbothmulti1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ through invalid pointer arithmetic, an unsafe cast, etc.*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -120,10 +119,10 @@ int * foo() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }

int * bar() {
Expand All @@ -132,9 +131,9 @@ int * bar() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
z += 2;
return z; }
5 changes: 2 additions & 3 deletions clang/test/CheckedCRewriter/arrbothmulti2.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ through invalid pointer arithmetic, an unsafe cast, etc.*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -117,7 +116,7 @@ x = (int *) 5;
//CHECK: x = (int *) 5;
int *z = calloc(5, sizeof(int));
//CHECK_NOALL: int *z = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
int i, fac;
int *p;
//CHECK_NOALL: int *p;
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CheckedCRewriter/arrboundsbasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ Basic array bounds tests (without any data-flow analysis).
*/


typedef unsigned long size_t;
#include <stddef.h>

#define NULL 0
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CheckedCRewriter/arrboundsbasicinfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ Basic array bounds tests (without any data-flow analysis).
*/


typedef unsigned long size_t;
#include <stddef.h>

#define NULL 0
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);


Expand Down
2 changes: 1 addition & 1 deletion clang/test/CheckedCRewriter/arrboundsbyte.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Array bounds (byte_bound) tests with data-flow analysis.
*/

typedef unsigned long size_t;
#include <stddef.h>
_Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
int *memcpy(int * restrict dest : itype(restrict _Array_ptr<int>) byte_count(n),
const int * restrict src : itype(restrict _Array_ptr<const int>) byte_count(n),
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CheckedCRewriter/arrboundsheuristics.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

int *glob;
int lenplusone;
typedef unsigned long size_t;
#include <stddef.h>
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
//CHECK_ALL: _Array_ptr<int> glob = ((void *)0);
//CHECK_NOALL: int *glob;
Expand Down
3 changes: 1 addition & 2 deletions clang/test/CheckedCRewriter/arrboundsinfer2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ Basic array bounds tests (without any data-flow analysis).
*/


typedef unsigned long size_t;
#include <stddef.h>

#define NULL 0
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
extern void ext_func(_Array_ptr<int> arr: count(len), unsigned len);

Expand Down
13 changes: 6 additions & 7 deletions clang/test/CheckedCRewriter/arrcallee.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ not, through invalid pointer arithmetic, an unsafe cast, etc*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -109,7 +108,7 @@ x = (int *) 5;
//CHECK: x = (int *) 5;
int *z = calloc(5, sizeof(int));
//CHECK_NOALL: int *z = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
int i, fac;
int *p;
//CHECK_NOALL: int *p;
Expand All @@ -127,10 +126,10 @@ int * foo() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }

int * bar() {
Expand All @@ -139,8 +138,8 @@ int * bar() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }
11 changes: 5 additions & 6 deletions clang/test/CheckedCRewriter/arrcalleemulti1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ not, through invalid pointer arithmetic, an unsafe cast, etc*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -120,10 +119,10 @@ int * foo() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }

int * bar() {
Expand All @@ -132,8 +131,8 @@ int * bar() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }
5 changes: 2 additions & 3 deletions clang/test/CheckedCRewriter/arrcalleemulti2.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ not, through invalid pointer arithmetic, an unsafe cast, etc*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -117,7 +116,7 @@ x = (int *) 5;
//CHECK: x = (int *) 5;
int *z = calloc(5, sizeof(int));
//CHECK_NOALL: int *z = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
int i, fac;
int *p;
//CHECK_NOALL: int *p;
Expand Down
13 changes: 6 additions & 7 deletions clang/test/CheckedCRewriter/arrcaller.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ not, through invalid pointer arithmetic, an unsafe cast, etc.*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -109,7 +108,7 @@ x = (int *) 5;
//CHECK: x = (int *) 5;
int *z = calloc(5, sizeof(int));
//CHECK_NOALL: int *z = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
int i, fac;
int *p;
//CHECK_NOALL: int *p;
Expand All @@ -126,10 +125,10 @@ int * foo() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }

int * bar() {
Expand All @@ -138,9 +137,9 @@ int * bar() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
z += 2;
return z; }
11 changes: 5 additions & 6 deletions clang/test/CheckedCRewriter/arrcallermulti1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ not, through invalid pointer arithmetic, an unsafe cast, etc.*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -120,10 +119,10 @@ int * foo() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
return z; }

int * bar() {
Expand All @@ -132,9 +131,9 @@ int * bar() {
int * x = malloc(sizeof(int));
//CHECK: int * x = malloc<int>(sizeof(int));
int * y = malloc(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
//CHECK: _Ptr<int> y = malloc<int>(sizeof(int));
int * z = sus(x, y);
//CHECK_NOALL: int * z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
//CHECK_ALL: _Array_ptr<int> z = sus(x, y);
z += 2;
return z; }
5 changes: 2 additions & 3 deletions clang/test/CheckedCRewriter/arrcallermulti2.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ not, through invalid pointer arithmetic, an unsafe cast, etc.*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -117,7 +116,7 @@ x = (int *) 5;
//CHECK: x = (int *) 5;
int *z = calloc(5, sizeof(int));
//CHECK_NOALL: int *z = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
//CHECK_ALL: _Array_ptr<int> z : count(5) = calloc<int>(5, sizeof(int));
int i, fac;
int *p;
//CHECK_NOALL: int *p;
Expand Down
9 changes: 4 additions & 5 deletions clang/test/CheckedCRewriter/arrinstructboth.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ through invalid pointer arithmetic, an unsafe cast, etc.*/
/*********************************************************************************/


typedef unsigned long size_t;
#define NULL 0
#include <stddef.h>
extern _Itype_for_any(T) void *calloc(size_t nmemb, size_t size) : itype(_Array_ptr<T>) byte_count(nmemb * size);
extern _Itype_for_any(T) void free(void *pointer : itype(_Array_ptr<T>) byte_count(0));
extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr<T>) byte_count(size);
Expand Down Expand Up @@ -112,7 +111,7 @@ x = (struct warr *) 5;
//CHECK_ALL: char name _Checked[20];
struct warr *z = y;
//CHECK_NOALL: struct warr *z = y;
//CHECK_ALL: _Array_ptr<struct warr> z = y;
//CHECK_ALL: _Array_ptr<struct warr> z = y;
int i;
for(i = 0; i < 5; i++) {
//CHECK_NOALL: for(i = 0; i < 5; i++) {
Expand All @@ -132,7 +131,7 @@ struct warr * foo() {
//CHECK: struct warr * y = malloc<struct warr>(sizeof(struct warr));
struct warr * z = sus(x, y);
//CHECK_NOALL: struct warr * z = sus(x, y);
//CHECK_ALL: _Ptr<struct warr> z = sus(x, y);
//CHECK_ALL: _Ptr<struct warr> z = sus(x, y);
return z; }

struct warr * bar() {
Expand All @@ -144,6 +143,6 @@ struct warr * bar() {
//CHECK: struct warr * y = malloc<struct warr>(sizeof(struct warr));
struct warr * z = sus(x, y);
//CHECK_NOALL: struct warr * z = sus(x, y);
//CHECK_ALL: _Array_ptr<struct warr> z = sus(x, y);
//CHECK_ALL: _Array_ptr<struct warr> z = sus(x, y);
z += 2;
return z; }
Loading