test case: Codegen/struct.c is failing with an assertion failure

Anyone else seeing this? Is this expected? This is on Mac OS 10.5.3.

$ ../TestRunner.sh struct.c
******************** TEST 'struct.c' FAILED! ********************
Command:
  clang struct.c -emit-llvm
Incorrect Output:
Assertion failed: (CGT.getTargetData().getABITypeSizeInBits(STy) == RL.getSize()), function layoutStructFields, file CodeGenTypes.cpp, line 531.
0 clang 0x002b5aa5 _ZN4llvm3sys20SetInterruptFunctionEPFvvE + 87
1 clang 0x002b5c11 _ZN4llvm3sys20SetInterruptFunctionEPFvvE + 451
2 libSystem.B.dylib 0x9135709b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libSystem.B.dylib 0x913cfec2 raise + 26
5 libSystem.B.dylib 0x913df47f abort + 73
6 libSystem.B.dylib 0x913d1063 __assert_rtn + 101
7 clang 0x0008207b _ZN5clang7CodeGen12CodeGenTypes20ConvertTypeRecursiveENS_8QualTypeE + 1289
8 clang 0x000822af _ZN5clang7CodeGen12CodeGenTypes18ConvertTagDeclTypeEPKNS_7TagDeclE + 541
9 clang 0x00081a46 _ZN5clang7CodeGen12CodeGenTypes14ConvertNewTypeENS_8QualTypeE + 2052
10 clang 0x00081c0e _ZN5clang7CodeGen12CodeGenTypes20ConvertTypeRecursiveENS_8QualTypeE + 156
11 clang 0x000826cb _ZN5clang7CodeGen12CodeGenTypes11ConvertTypeENS_8QualTypeE + 25
12 clang 0x0008284f _ZN5clang7CodeGen12CodeGenTypes17ConvertTypeForMemENS_8QualTypeE + 31
13 clang 0x000789fe _ZN5clang7CodeGen13CodeGenModule17EmitGlobalVarInitEPKNS_7VarDeclE + 154
14 clang 0x00079112 _ZN5clang7CodeGen13CodeGenModule13EmitGlobalVarEPKNS_7VarDeclE + 126
15 clang 0x0007913d _ZN5clang7CodeGen13CodeGenModule23EmitGlobalVarDeclaratorEPKNS_7VarDeclE + 41
16 clang 0x000878de _ZN5clang17CreateLLVMCodeGenERNS_10DiagnosticERKNS_11LangOptionsERPN4llvm6ModuleEb + 484
17 clang 0x000e96f9 _ZN5clang8ParseASTERNS_12PreprocessorEPNS_11ASTConsumerEb + 371
18 clang 0x0002d31c _Z16InitializeGCModeRN5clang11LangOptionsE + 5546
19 clang 0x00030b5b main + 1353
20 clang 0x00002466 start + 54
Output/struct.c.out.script: line 1: 38765 Abort trap clang struct.c -emit-llvm
******************** TEST 'struct.c' FAILED! ********************

Probably my fault; I'll look into it.

-Eli

Does clang r51944 fix this?

-Eli

Unfortunately it doesn't:

$ ../TestRunner.sh struct.c
******************** TEST 'struct.c' FAILED! ********************
Command:
  clang struct.c -emit-llvm
Incorrect Output:
Assertion failed: (CGT.getTargetData().getABITypeSizeInBits(STy) == RL.getSize()), function layoutStructFields, file CodeGenTypes.cpp, line 531.
0 clang 0x002b5aad _ZN4llvm3sys20SetInterruptFunctionEPFvvE + 87
1 clang 0x002b5c19 _ZN4llvm3sys20SetInterruptFunctionEPFvvE + 451
2 libSystem.B.dylib 0x9135709b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libSystem.B.dylib 0x913cfec2 raise + 26
5 libSystem.B.dylib 0x913df47f abort + 73
6 libSystem.B.dylib 0x913d1063 __assert_rtn + 101
7 clang 0x00081fab _ZN5clang7CodeGen12CodeGenTypes20ConvertTypeRecursiveENS_8QualTypeE + 1289
8 clang 0x000821df _ZN5clang7CodeGen12CodeGenTypes18ConvertTagDeclTypeEPKNS_7TagDeclE + 541
9 clang 0x00081976 _ZN5clang7CodeGen12CodeGenTypes14ConvertNewTypeENS_8QualTypeE + 2052
10 clang 0x00081b3e _ZN5clang7CodeGen12CodeGenTypes20ConvertTypeRecursiveENS_8QualTypeE + 156
11 clang 0x000825fb _ZN5clang7CodeGen12CodeGenTypes11ConvertTypeENS_8QualTypeE + 25
12 clang 0x0008277f _ZN5clang7CodeGen12CodeGenTypes17ConvertTypeForMemENS_8QualTypeE + 31
13 clang 0x0007892e _ZN5clang7CodeGen13CodeGenModule17EmitGlobalVarInitEPKNS_7VarDeclE + 154
14 clang 0x00079042 _ZN5clang7CodeGen13CodeGenModule13EmitGlobalVarEPKNS_7VarDeclE + 126
15 clang 0x0007906d _ZN5clang7CodeGen13CodeGenModule23EmitGlobalVarDeclaratorEPKNS_7VarDeclE + 41
16 clang 0x000877ec _ZN5clang17CreateLLVMCodeGenERNS_10DiagnosticERKNS_11LangOptionsERPN4llvm6ModuleEb + 484
17 clang 0x000e9611 _ZN5clang8ParseASTERNS_12PreprocessorEPNS_11ASTConsumerEb + 383
18 clang 0x0002d1b0 _Z16InitializeGCModeRN5clang11LangOptionsE + 5534
19 clang 0x000309ef main + 1353
20 clang 0x00002652 start + 54
Output/struct.c.out.script: line 1: 64740 Abort trap clang struct.c -emit-llvm
******************** TEST 'struct.c' FAILED! ********************

Is there any particular information you need to debug this? I'm not very familiar with the Codegen module.

That assertion essentially means that the LLVM type isn't ending up
with the expected size according to the layout done in Sema.

I tried committing another fix; could you see if it helps?

-Eli

That fixed it. Thanks!

I have
$ svnversion .
51965
$ ../../../Debug/bin/clang CodeGen/struct.c -o /tmp/a --emit-llvm
Assertion failed: (CGT.getTargetData().getABITypeSizeInBits(STy) == RL.getSize()), function layoutStructFields, file CodeGenTypes.cpp, line 531.

Do you see this failure ?

I saw this failure earlier, but one of Eli's patches fixed it for me:

(kremenek@grue:CodeGen)$ clang struct.c -emit-llvm
(kremenek@grue:CodeGen)$

I assume your local LLVM copy is also TOT?

Updating LLVM copy helps. Thanks!