forked from csmith-project/creduce
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
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);
}