Skip to content

Commit

Permalink
Reapply #2 [clang-repl] [test] Make an XFAIL more precise (#71168)
Browse files Browse the repository at this point in the history
The const.cpp testcase fails when running in MSVC mode, while it does
succeed in MinGW mode.

In MSVC mode, there are more constructor invocations than expected, as
the printout looks like this:

    A(1), this = 0000025597930000
    A(1), this = 0000025597930000
    f: this = 0000025597930000, val = 1
    A(1), this = 0000025597930000
    f: this = 0000025597930000, val = 1
    ~A, this = 0000025597930000, val = 1
    ~A, this = 0000025597930000, val = 1
    ~A, this = 0000025597930000, val = 1

While the expected printout looks like this:

    A(1), this = 000002C903E10000
    f: this = 000002C903E10000, val = 1
    f: this = 000002C903E10000, val = 1
    ~A, this = 000002C903E10000, val = 1

Reapplying #70991 with the XFAIL changed to check the host triple, not
the target triple. On an MSVC based build of Clang, but with the default
target triple set to PS4/PS5, we will still see the failure. And a Linux
based build of Clang that targets PS4/PS5 won't see the issue.
  • Loading branch information
mstorsjo committed Nov 7, 2023
1 parent cab0a19 commit 2c4f938
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion clang/test/Interpreter/const.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// UNSUPPORTED: system-aix
// see https://github.com/llvm/llvm-project/issues/68092
// XFAIL: system-windows
// XFAIL: host={{.*}}-windows-msvc

// RUN: cat %s | clang-repl | FileCheck %s
// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
Expand Down
4 changes: 0 additions & 4 deletions llvm/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,6 @@ def have_cxx_shared_library():
if not config.target_triple.startswith(("nvptx", "xcore")):
config.available_features.add("object-emission")

# Allow checking for specific details in the host triple
if config.host_triple:
config.available_features.add('host=%s' % config.host_triple)

if config.have_llvm_driver:
config.available_features.add("llvm-driver")

Expand Down
1 change: 1 addition & 0 deletions llvm/utils/lit/lit/llvm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(self, lit_config, config):
# part of the standard header. But currently they aren't)
host_triple = getattr(config, "host_triple", None)
target_triple = getattr(config, "target_triple", None)
features.add("host=%s" % host_triple)
features.add("target=%s" % target_triple)
if host_triple and host_triple == target_triple:
features.add("native")
Expand Down

0 comments on commit 2c4f938

Please sign in to comment.