Here is a test case for the crash.

I looked over the C standard, and it doesn't specify any actual size or
padding requirements for _Bool.  Not much of a surprise.  I'm going to
look at what GCC does, since I figure we want binaries compiled with
clang to work when linked against binaries compiled with gcc on the same
arch/platform.

Note that I'm running on an Linux/amd64.  Not sure if this bug occurs on
other archs.

$ clang -emit-llvm _boolpad.c 

clang: CodeGenTypes.cpp:471:
void<unnamed>::RecordOrganizer::addPaddingFields(unsigned int):
Assertion `(RequiredBits % 8) == 0 && "FIXME Invalid struct layout"'
failed.


On Sun, 2007-12-09 at 16:14 -0500, Sean Middleditch wrote:
> Worked on tracking down the crash I have with my small test app, a.k.a.
> clc.
> 
> The crash is actually a failed assertion at
> RecordOrganizer::addPaddingFields, due to the RequiredBits not being a
> multiple of 8.
// RUN: clang -emit-llvm %s

struct test {
	_Bool b;
	int i;
};

int main (int argc, char** argv) {
	struct test t;
	return 0;
}
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to