Skip to content

Commit 5093f3a

Browse files
vgvassilevmahesh-attarde
authored andcommitted
[clang-repl] Another try on system-z.
This patch should make msan happy as it found a real bug where we always try to read an unsigned long long without respecting the underlying enum type. Another follow-up on llvm#102858
1 parent 26f35ac commit 5093f3a

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

clang/lib/Interpreter/InterpreterValuePrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static std::string EnumToString(const Value &V) {
106106
assert(EnumTy && "Fail to cast to enum type");
107107

108108
EnumDecl *ED = EnumTy->getDecl();
109-
uint64_t Data = V.getULongLong();
109+
uint64_t Data = V.convertTo<uint64_t>();
110110
bool IsFirst = true;
111111
llvm::APSInt AP = Ctx.MakeIntValue(Data, DesugaredTy);
112112

clang/test/Interpreter/pretty-print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \
22
// RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s
3-
// UNSUPPORTED: system-aix, system-zos, asan
3+
// UNSUPPORTED: system-aix
44
// CHECK-DRIVER: i = 10
55
// RUN: cat %s | clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing | FileCheck %s
66
extern "C" int printf(const char*,...);

clang/unittests/Interpreter/InterpreterTest.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,6 @@ TEST_F(InterpreterTest, Value) {
392392
EXPECT_EQ(V9.getKind(), Value::K_PtrOrObj);
393393
EXPECT_TRUE(V9.isManuallyAlloc());
394394

395-
if (llvm::Triple(llvm::sys::getDefaultTargetTriple()).isSystemZ())
396-
GTEST_SKIP(); // Enum printing is broken for unknown reasons on SystemZ.
397-
398395
Value V10;
399396
llvm::cantFail(Interp->ParseAndExecute(
400397
"enum D : unsigned int {Zero = 0, One}; One", &V10));

0 commit comments

Comments
 (0)