more infos on test CodeGen/array.c failure

On my Debian x86_64 the test CodeGen/array.c fails with a segmentation fault. I've modified function f2() of test array.c to try to find exactly when it fails,these are my results :
Array initialization with at least one variable never fails. (ex. int c2[5] = {y, 1, 2, 3, 4}:wink:
Array initialization with just immediate values sometimes fails,it depends on the array type(int and double fails,all the other types don't).
(the lines commented are those that fail)
int f2() {
  int x = 0;
  int y = 1;
  int a[10] = { y, x, 2, 3};
  int b[10] = { 2,4,x,6,y,8};
  //int c0[5] = {0, 1, 2, 3, 4}; --> fails
  //int c1[5] = { 0,1,2,3}; -->fails
  int c2[5] = {y, 1, 2, 3, 4};
  int c3[5] = {0, y, 2, 3, 4};
  int c4[5] = {0, 1, y, 3, 4};
  int c5[5] = {0, 1, 2, y, 4};
  int c6[5] = {0, 1, 2, 3, y};
  int c7[5] = {x, x, x, x, x};
  int c8[5] = { x,1,2,3};
  int c9[5] = { 0,x,2,3};
  int c10[5] = { 0,1,x,3};
  int c11[5] = { 0,1,2,x};
  long long c12[5] = {0, 1, 2, 3, 4};
  long long c13[5] = {0, 1, 2, 3};
  long long z = 400;
  long long c14[5] = {z, 1, 2, 3};
  long long c15[5] = {0, z, 2, 3};
  long long c16[5] = {0, 1, z, 3};
  long long c17[5] = {0, 1, 2, z};
  long long c18[5] = {z, z, z, z};
  long long c19[5] = {z, 1, 2, 3, 4};
  long long c20[5] = {0, z, 2, 3, 4};
  long long c21[5] = {0, 1, z, 3, 4};
  long long c22[5] = {0, 1, 2, z, 4};
  long long c23[5] = {0, 1, 2, 3, z};
  char c24[5] = {0, 1, 2, 3, 4};
  char c25[5] = {0, 1, 2, 3};
  short c26[5] = {0, 1, 2, 3, 4};
  short c27[5] = {0, 1, 2, 3};
  //unsigned int c28[5] = {0, 1, 2, 3, 4}; -->fails
  //unsigned int c29[5] = {0, 1, 2, 3}; -->fails
  float c30[5] = {0.1, 1.1, 2.1, 3.1, 4.1};
  float c31[5] = {0.2, 1.2, 2.2, 3.2};
  //double c32[5] = {0.1, 1.1, 2.1, 3.1, 4.1}; -->fails
  //double c33[5] = {0.2, 1.2, 2.2, 3.2}; -->fails
}

I couldn't test arrays of structs because of strange behaviour,maye not implemented yet?

P.S. I've noticed that for variables of type "long" clang produces 32bit code(and array initialization fails like for normal ints),but on x86_64 shouldn't it produce 64bit code?

On my Debian x86_64 the test CodeGen/array.c fails with a segmentation fault. I've modified function f2() of test array.c to try to find exactly when it fails,these are my results :
Array initialization with at least one variable never fails. (ex. int c2[5] = {y, 1, 2, 3, 4}:wink:
Array initialization with just immediate values sometimes fails,it depends on the array type(int and double fails,all the other types don't).
(the lines commented are those that fail)
int f2() {
  int x = 0;
  int y = 1;
  int a[10] = { y, x, 2, 3};
  int b[10] = { 2,4,x,6,y,8};
  //int c0[5] = {0, 1, 2, 3, 4}; --> fails
  //int c1[5] = { 0,1,2,3}; -->fails
  int c2[5] = {y, 1, 2, 3, 4};
  int c3[5] = {0, y, 2, 3, 4};
  int c4[5] = {0, 1, y, 3, 4};
  int c5[5] = {0, 1, 2, y, 4};
  int c6[5] = {0, 1, 2, 3, y};
  int c7[5] = {x, x, x, x, x};
  int c8[5] = { x,1,2,3};
  int c9[5] = { 0,x,2,3};
  int c10[5] = { 0,1,x,3};
  int c11[5] = { 0,1,2,x};
  long long c12[5] = {0, 1, 2, 3, 4};
  long long c13[5] = {0, 1, 2, 3};
  long long z = 400;
  long long c14[5] = {z, 1, 2, 3};
  long long c15[5] = {0, z, 2, 3};
  long long c16[5] = {0, 1, z, 3};
  long long c17[5] = {0, 1, 2, z};
  long long c18[5] = {z, z, z, z};
  long long c19[5] = {z, 1, 2, 3, 4};
  long long c20[5] = {0, z, 2, 3, 4};
  long long c21[5] = {0, 1, z, 3, 4};
  long long c22[5] = {0, 1, 2, z, 4};
  long long c23[5] = {0, 1, 2, 3, z};
  char c24[5] = {0, 1, 2, 3, 4};
  char c25[5] = {0, 1, 2, 3};
  short c26[5] = {0, 1, 2, 3, 4};
  short c27[5] = {0, 1, 2, 3};
  //unsigned int c28[5] = {0, 1, 2, 3, 4}; -->fails
  //unsigned int c29[5] = {0, 1, 2, 3}; -->fails
  float c30[5] = {0.1, 1.1, 2.1, 3.1, 4.1};
  float c31[5] = {0.2, 1.2, 2.2, 3.2};
  //double c32[5] = {0.1, 1.1, 2.1, 3.1, 4.1}; -->fails
  //double c33[5] = {0.2, 1.2, 2.2, 3.2}; -->fails
}

Pretty strange. I will try and look into this within the next week (I'm currently focused on some other stuff).

Thanks for the test case.

I couldn't test arrays of structs because of strange behaviour,maye not implemented yet?

Yes...it isn't implemented yet (fyi...there is a FIXME in the code).

snaroff