Skip to content

[clang][Interp][NFC] Add a failing test case #102801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2024
Merged

Conversation

tbaederr
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Aug 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 11, 2024

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/102801.diff

1 Files Affected:

  • (modified) clang/test/AST/Interp/cxx20.cpp (+44)
diff --git a/clang/test/AST/Interp/cxx20.cpp b/clang/test/AST/Interp/cxx20.cpp
index 27dbd2818be60..389d9d883725f 100644
--- a/clang/test/AST/Interp/cxx20.cpp
+++ b/clang/test/AST/Interp/cxx20.cpp
@@ -858,3 +858,47 @@ namespace DefinitionLoc {
   constexpr NonConstexprCopy ncc2 = ncc1; // both-error {{constant expression}} \
                                           // both-note {{non-constexpr constructor}}
 }
+
+/// FIXME: Call base dtors when explicitly calling dtor.
+namespace VirtDtor {
+  class B {
+  public:
+    constexpr B(char *p) : p(p) {}
+    virtual constexpr ~B() {
+      *p = 'B';
+      ++p;
+    }
+
+    char *p;
+  };
+
+  class C : public B {
+  public:
+    constexpr C(char *p) : B(p) {}
+    virtual constexpr ~C() override {
+      *p = 'C';
+      ++p;
+    }
+  };
+
+  union U {
+    constexpr U(char *p) : c(p) {}
+    constexpr ~U() {}
+
+    C c;
+  };
+
+  constexpr int test(char a, char b) {
+    char buff[2] = {};
+    U u(buff);
+
+    /// U is a union, so it won't call the destructor of its fields.
+    /// We do this manually here. Explicitly calling ~C() here should
+    /// also call the destructor of the base classes however.
+    u.c.~C();
+
+    return buff[0] == a && buff[1] == b;
+  }
+
+  static_assert(test('C', 'B')); // expected-error {{failed}}
+}

@tbaederr tbaederr merged commit 2a00bf4 into llvm:main Aug 11, 2024
10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 11, 2024

LLVM Buildbot has detected a new failure on builder lldb-aarch64-windows running on linaro-armv8-windows-msvc-05 while building clang at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/1466

Here is the relevant piece of the build log for the reference:

Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: tools/lldb-dap/variables/children/TestDAP_variables_children.py (1147 of 1998)
UNSUPPORTED: lldb-api :: tools/lldb-server/TestGdbRemoteAuxvSupport.py (1148 of 1998)
PASS: lldb-api :: tools/lldb-server/TestGdbRemoteAttach.py (1149 of 1998)
PASS: lldb-api :: tools/lldb-server/TestGdbRemoteCompletion.py (1150 of 1998)
PASS: lldb-api :: tools/lldb-server/TestGdbRemoteExitCode.py (1151 of 1998)
UNSUPPORTED: lldb-api :: tools/lldb-server/TestGdbRemoteFork.py (1152 of 1998)
UNSUPPORTED: lldb-api :: tools/lldb-server/TestGdbRemoteForkNonStop.py (1153 of 1998)
PASS: lldb-api :: tools/lldb-server/TestGdbRemoteHostInfo.py (1154 of 1998)
PASS: lldb-api :: tools/lldb-server/TestGdbRemoteExpeditedRegisters.py (1155 of 1998)
PASS: lldb-api :: tools/lldb-server/TestGdbRemoteKill.py (1156 of 1998)
FAIL: lldb-api :: tools/lldb-server/TestGdbRemoteLaunch.py (1157 of 1998)
******************** TEST 'lldb-api :: tools/lldb-server/TestGdbRemoteLaunch.py' FAILED ********************
Script:
--
C:/Users/tcwg/scoop/apps/python/current/python.exe C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/llvm-project/lldb\test\API\dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/llvm-objcopy.exe --env LLVM_LIBS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --env LLVM_INCLUDE_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/include --env LLVM_TOOLS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --arch aarch64 --build-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex --lldb-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-lldb\lldb-api --clang-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-clang\lldb-api --executable C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/lldb.exe --compiler C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/clang.exe --dsymutil C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/dsymutil.exe --llvm-tools-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --lldb-obj-root C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/tools/lldb --lldb-libs-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --skip-category=watchpoint C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\tools\lldb-server -p TestGdbRemoteLaunch.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 2a00bf412efec1f87fed0762ee42dd7a6b809cbb)
  clang revision 2a00bf412efec1f87fed0762ee42dd7a6b809cbb
  llvm revision 2a00bf412efec1f87fed0762ee42dd7a6b809cbb
Skipping the following test categories: ['watchpoint', 'libc++', 'libstdcxx', 'dwo', 'dsym', 'gmodules', 'debugserver', 'objc', 'fork', 'pexpect']


--
Command Output (stderr):
--
UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_QEnvironmentHexEncoded_llgs (TestGdbRemoteLaunch.GdbRemoteLaunchTestCase.test_QEnvironmentHexEncoded_llgs) (skip on windows) 

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_QEnvironment_llgs (TestGdbRemoteLaunch.GdbRemoteLaunchTestCase.test_QEnvironment_llgs) (skip on windows) 

PASS: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_launch_failure_via_vRun_llgs (TestGdbRemoteLaunch.GdbRemoteLaunchTestCase.test_launch_failure_via_vRun_llgs)

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_launch_via_A_llgs (TestGdbRemoteLaunch.GdbRemoteLaunchTestCase.test_launch_via_A_llgs) (skip on windows) 

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_launch_via_vRun_llgs (TestGdbRemoteLaunch.GdbRemoteLaunchTestCase.test_launch_via_vRun_llgs) (skip on windows) 

FAIL: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_launch_via_vRun_no_args_llgs (TestGdbRemoteLaunch.GdbRemoteLaunchTestCase.test_launch_via_vRun_no_args_llgs)

======================================================================

FAIL: test_launch_via_vRun_no_args_llgs (TestGdbRemoteLaunch.GdbRemoteLaunchTestCase.test_launch_via_vRun_no_args_llgs)

----------------------------------------------------------------------

Traceback (most recent call last):


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants