mpflanzer / creduce Goto Github PK
View Code? Open in Web Editor NEWThis project forked from csmith-project/creduce
C-Reduce, a C program reducer
Home Page: http://embed.cs.utah.edu/creduce/
License: Other
This project forked from csmith-project/creduce
C-Reduce, a C program reducer
Home Page: http://embed.cs.utah.edu/creduce/
License: Other
If designated initialisers are used remove-unused-struct-field creduce fails to remove the designator from the initialiser list. The field and the initialiser(s) are nevertheless removed which leads to invalid code.
Run test-case with:
$ clang_delta --transformation=remove-unused-field --counter=1 test.cl
Test-case:
typedef const unsigned int test;
typedef test test_second;
int foo(long t)
{
return t + 8;
}
struct T;
struct Z
{
int z1;
};
struct W
{
int w_a1[5];
//int w1;
};
struct X
{
int x1;
int x_a1[5];
struct W x_w1[2];
struct Z x_z1;
};
void bar(struct W blubb)
{
struct W i = blubb;
}
__kernel void entry(__global long *input)
{
uint test1;
int4 test2;
struct T
{
int t1;
struct Z t_z1;
struct Z t_z2;
};
struct X x = {1, {11,12,13,14,15,}, {{{21,22}}, {{211}}}, {3}};
struct T t;
struct Z z = {0};
struct W w = {.w_a1 = {0, 0, 0,}, };
struct W *wp = &w;
bar(w);
foo(z.z1);
//test1 = s.f;
get_global_id(0);
}
Output:
typedef const unsigned int test;
typedef test test_second;
int foo(long t)
{
return t + 8;
}
struct T;
struct Z
{
int z1;
};
struct W
{
//int w1;
};
struct X
{
int x1;
int x_a1[5];
struct W x_w1[2];
struct Z x_z1;
};
void bar(struct W blubb)
{
struct W i = blubb;
}
__kernel void entry(__global long *input)
{
uint test1;
int4 test2;
struct T
{
int t1;
struct Z t_z1;
struct Z t_z2;
};
struct X x = {1, {11,12,13,14,15,}, {{}, {}}, {3}};
struct T t;
struct Z z = {0};
struct W w = {.w_a1 = };
struct W *wp = &w;
bar(w);
foo(z.z1);
//test1 = s.f;
get_global_id(0);
}
Some functions in the clex driver do not set the matched variable and thus exit always with -1. Is this intentional?
For instance: https://github.com/mpflanzer/creduce/blob/master/clex/driver.c#L347
For partial initialiser lists it can happen that remove-unused-field removes the last initialiser. But an empty list is only valid in GNU C.
Should then a zero be inserted into the list to make it valid again?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.