nightly test suite failure: ms_struct-bitfield-init-1.c

Hi,

I've just tried to run the test-suite, for the first time in ages. It
stops rather abruptly with:

$ make TEST=nightly report report.html

/home/jay/llvm/local/bin/llvm-gcc
-I/home/jay/llvm/gitobjdir/projects/test-suite/SingleSource/UnitTests
-I/home/jay/svn/llvm-project/test-suite/trunk/SingleSource/UnitTests
-I/home/jay/git/llvm/projects/test-suite/include -I../../include
-I/home/jay/llvm/gitobjdir/include -I/home/jay/git/llvm/include
-D_GNU_SOURCE -D__STDC_LIMIT_MACROS -DNDEBUG -O3 -mllvm
-disable-llvm-optzns -m64 -fomit-frame-pointer -S
/home/jay/svn/llvm-project/test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c
-o Output/ms_struct-bitfield-init-1.ll -emit-llvm
/home/jay/svn/llvm-project/test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c:28:
error: size of array ‘a3’ is negative
make[3]: [Output/ms_struct-bitfield-init-1.ll] Error 1 (ignored)
/home/jay/llvm/gitobjdir/Release+Asserts/bin/llvm-as
Output/ms_struct-bitfield-init-1.ll -o
Output/ms_struct-bitfield-init-1.bc
/home/jay/llvm/gitobjdir/Release+Asserts/bin/llvm-as:
Output/ms_struct-bitfield-init-1.ll: Could not open input file: No
such file or directory
make[3]: *** [Output/ms_struct-bitfield-init-1.bc] Error 1

This seems wrong -- if a test fails, it shouldn't stop the whole
"make", it should just get logged as a failure and continue.

Any idea what's going on?

I'm using llvm and llvm-gcc-4.2 built from git/svn respectively,
updated a few moments ago.

Thanks,
Jay.

Hi,

I've just tried to run the test-suite, for the first time in ages. It
stops rather abruptly with:

$ make TEST=nightly report report.html

This is a test that Fariborz has been working on with Clang. It is possible that llvm-gcc is expected to fail it, if this is so, the test can be put in an #ifdef __clang__. Fariborz, can you take a look?

-Chris

Hi,

I've just tried to run the test-suite, for the first time in ages. It
stops rather abruptly with:

$ make TEST=nightly report report.html

This is a test that Fariborz has been working on with Clang. It is possible that llvm-gcc is expected to fail it, if this is so, the test can be put in an #ifdef __clang__. Fariborz, can you take a look?

llvm-gcc must pass the test. It passes with llvm-gcc (LLVM build 2335.6). If it fails with latest llvm-gcc, it means that llvm-gcc is broken.

- fariborz

That's a frustrating aspect of the test-suite Makefiles. I don't know how to work around it without removing the test from your tree.
-Andy

This seems wrong -- if a test fails, it shouldn't stop the whole
"make", it should just get logged as a failure and continue.

That's a frustrating aspect of the test-suite Makefiles. I don't know how to work around it without removing the test from your tree.

Is any body trying to figure out why test failed. It is a serious regression lying out bitfields. It has been passing with llvm-gcc until today's
failure.

- Fariborz

$ make -k ...
is your friend here.

Fariborz,

Fariborz,

This seems wrong -- if a test fails, it shouldn't stop the whole
"make", it should just get logged as a failure and continue.

That's a frustrating aspect of the test-suite Makefiles. I don't know how to work around it without removing the test from your tree.

Is any body trying to figure out why test failed. It is a serious regression lying out bitfields. It has been passing with llvm-gcc until today's
failure.

It is failing to compile. Are you sure that it can compile on all platforms ?

Test fails to compile if layout is not right. It is meant only for x86_64 and i386 though. But we did not have such failures in the past.

- fariborz

This test is still failing for me. Is anyone else seeing this? Is
anyone else running the nightly tests with llvm-gcc?

Thanks,
Jay.

If I compile this test by hand, I get the same error:

$ llvm-gcc -c ms_struct-bitfield-init-1.c -o /dev/null
ms_struct-bitfield-init-1.c:28: error: size of array ‘a3’ is negative

If I compile it with the system GCC, I *still* get the same error:

$ gcc --version
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -c ms_struct-bitfield-init-1.c -o /dev/null
ms_struct-bitfield-init-1.c:28:12: error: size of array ‘a3’ is negative

So how is this test supposed to pass on Linux/x86_64 ?

Jay.

The problem is that GCC only seems to implement #pragma ms_struct on
Darwin. On Linux I get:

$ gcc -c -Wunknown-pragmas ms_struct-bitfield-init-1.c -o /dev/null
ms_struct-bitfield-init-1.c:20:0: warning: ignoring #pragma ms_struct on
ms_struct-bitfield-init-1.c:27:0: warning: ignoring #pragma ms_struct off
ms_struct-bitfield-init-1.c:28:12: error: size of array ‘a3’ is negative

So how about the attached patch? OK to commit?

Thanks,
Jay.

pragma-ms-struct (870 Bytes)

So how about the attached patch? OK to commit?

Or here's a different way of patching it, if you prefer.

Thanks,
Jay.

pragma-ms-struct-2 (989 Bytes)

This looks good. Please commit, thanks!

  - Doug