Newly failing tests on Windows, assert in PCHReader.cpp, new argument

30 tests are failing on Windows, 27 newly since Monday.

25 of them are due to an assert at line 172 in PCHReader.cpp.

The problem is that the file path appended to the Predefines has been converted to use double-’’, whereas the path in OriginalFileName used single ‘/’.

I’m not sure which side to change.

The other is in CodeGenCXX/new-operator-phi.cpp:

1> Line 4: ‘operator new’ takes type size_t (‘unsigned int’) as first parameter

I’m not sure what you want to do here, whether to change it to use size_t and to include stddef.h, or put in a platform conditional.

-John

We already use stddef.h for such types as ptrdiff_t. Let’s do it for size_t as well.

  • Fariborz

Also, I missed this failing test in my last message:

1>FAIL: Clang::CodeGenCXX/new.cpp (538 of 1739)
1>******************** TEST ‘Clang::CodeGenCXX/new.cpp’ FAILED ********************
1>Script:
1>–
1>C:/Tools/llvm/bin/Debug/clang-cc.exe C:\Tools\llvm\tools\clang\test\CodeGenCXX\new.cpp -emit-llvm -o - | FileCheck C:\Tools\llvm\tools\clang\test\CodeGenCXX\new.cpp
1>–
1>Exit Code: 1
1>Command Output (stdout):
1>–
1>Command 0: “C:/Tools/llvm/bin/Debug/clang-cc.exe” “C:\Tools\llvm\tools\clang\test\CodeGenCXX\new.cpp” “-emit-llvm” “-o” “-”
1>Command 0 Result: 1
1>Command 0 Output:
1>Command 0 Stderr:
1>C:\Tools\llvm\tools\clang\test\CodeGenCXX\new.cpp:8:7: error: ‘operator new’ takes type size_t (‘unsigned int’) as first parameter
1>void* operator new(unsigned long, void*) throw();
1> ^
1>1 diagnostic generated.
1>Command 1: “FileCheck” “C:\Tools\llvm\tools\clang\test\CodeGenCXX\new.cpp”
1>Command 1 Result: 1
1>Command 1 Output:
1>Command 1 Stderr:
1>C:\Tools\llvm\tools\clang\test\CodeGenCXX\new.cpp:35:32: error: expected string not found in input
1> // CHECK: call void @_ZN1TC1Ev
1> ^
1>:1:1: note: scanning from here
1>^
1>–
1>Command Output (stderr):
1>–
1>–

Then may I check in the enclosed changes?

Of question might be the changes to SemaCXX/new-delete.cpp, where I needed to change the type to something different from size_t for both Windows (unsigned int) and Unix (unsigned long), which I think is int. But if there is a platform using “int” for size_t, this will be a problem.

Thanks. (Sorry for the dup, Fariborz.)

-John

newargtype.patch (1.78 KB)

Here’s a patch which fixes the assertion failure in running the tests on Windows, basically matching what is done for the include directive put in the Predefines.

Should I check it in?

-John

pchfix.patch (969 Bytes)

Hi John,

SemaCXX/new-delete.cpp has already been changed to hopefully diagnose on all platforms.

- faribor

Sorry for the breakage, and for missing you patch. :slight_smile:

All issues seem to be fixed, currently.

- Daniel