http://llvm.org/bugs/show_bug.cgi?id=8516
Summary: Clang generates incorrect big endian multibyte
character strings
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
This is from the GCC testsuite.
On big endian architectures the string L"ab" is in little endian format. The C
code below generates the same string on both big and little endian
architectures:
@.str = private constant [12 x i8] c"a\00\00\00b\00\00\00\00\00\00\00" ; <[12 x
i8]*> [#uses=1]
For big endian the string generated by GCC is equivalent to:
@.str = private constant [12 x i8] c"\00\00\00a\00\00\00b\00\00\00\00" ; <[12 x
i8]*> [#uses=1]
extern void exit(int);
extern void abort(void);
int
main(void)
{
if (L"ab"[1] != L'b')
abort();
exit(0);
}
I tested this on qemu using a debian linux distribution.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs