[clang] b247776 - [clang][test] Fix instantiation-depth-default.cpp under ubsan config on Windows (#91021)

via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 08:51:16 PDT 2024


Author: Duo Wang
Date: 2024-05-07T16:51:12+01:00
New Revision: b2477765dbf9bd28bd2d1813c41ae12613f87717

URL: https://github.com/llvm/llvm-project/commit/b2477765dbf9bd28bd2d1813c41ae12613f87717
DIFF: https://github.com/llvm/llvm-project/commit/b2477765dbf9bd28bd2d1813c41ae12613f87717.diff

LOG: [clang][test] Fix instantiation-depth-default.cpp under ubsan config on Windows (#91021)

Clang test `instantiation-depth-default.cpp` fails on Windows when built
with `ubsan` due to extra warnings printed by the compiler:
```console
File instantiation-depth-default.cpp Line 11: stack nearly exhausted; compilation time may suffer, and crashes due to stack overflow are likely
```

Originally in https://github.com/llvm/llvm-project/pull/75254 this test
was enabled for `asan` as well but later started to cause failures in
Linux ASAN buildbots. I have excluded `asan` from this change.

Added: 
    

Modified: 
    clang/test/SemaTemplate/instantiation-depth-default.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaTemplate/instantiation-depth-default.cpp b/clang/test/SemaTemplate/instantiation-depth-default.cpp
index f5835b86b3a38..5934d4e542ee0 100644
--- a/clang/test/SemaTemplate/instantiation-depth-default.cpp
+++ b/clang/test/SemaTemplate/instantiation-depth-default.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-backtrace-limit=2 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-backtrace-limit=2 %if {{ubsan}} %{ -Wno-stack-exhausted %} %s
 //
 // FIXME: Disable this test when Clang was built with ASan, because ASan
 // increases our per-frame stack usage enough that this test no longer fits


        


More information about the cfe-commits mailing list