http://llvm.org/bugs/show_bug.cgi?id=15444

            Bug ID: 15444
           Summary: std::bitset<63> test fails on 32 bit target
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

If you modify testit to pass "-O2 -arch i386" when building tests, you get some
failures that don't happen when targeting -arch x86_64:

passed 2 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset
Assertion failed: (v[i] == (i & 1)), function test_val_ctor, file
ull_ctor.pass.cpp, line 25.
./testit: line 90: 38754 Abort trap: 6           ./$TEST_EXE
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
failed at run time
Compile line was: xcrun clang++ -std=c++0x -stdlib=libc++ -arch i386 -O2
-I/Users/bruce/Development/libcxx/test/support
-I/Users/bruce/Development/libcxx/include -L/Users/bruce/Development/libcxx/lib
ull_ctor.pass.cpp
failed 1 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.cons
passed 3 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.cons
passed 1 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.hash
Assertion failed: (j == v.to_ullong()), function test_to_ullong, file
to_ullong.pass.cpp, line 35.
./testit: line 90: 38896 Abort trap: 6           ./$TEST_EXE
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
failed at run time
Compile line was: xcrun clang++ -std=c++0x -stdlib=libc++ -arch i386 -O2
-I/Users/bruce/Development/libcxx/test/support
-I/Users/bruce/Development/libcxx/include -L/Users/bruce/Development/libcxx/lib
to_ullong.pass.cpp
failed 1 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.members
passed 25 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.members
passed 5 tests in
/Users/bruce/Development/libcxx/test/utilities/template.bitset/bitset.operators

While I reproduced this on Mac OS X (Mountain Lion), I initially found it when
porting the current version of libcxx to run with emscripten which targets a 32
bit processor.

The problem appears (to me) to be due to the 64 bit store for the "unsigned
long long" initial value being truncated to a 32 bit value (by inspecting the
LLVM IR). This seems to happen during the SROA pass, but it wasn't clear to me
if perhaps this was due to __first_ having an invalid type, since it is an
array of size_type  so a 64 bit value shouldn't be stored into it.

-- 
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

Reply via email to