From bf6d49bed14689730ea752c8926bd65321cb5561 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Wed, 3 Sep 2014 19:46:32 +0000 Subject: [PATCH] Add ubsan/not_ubsan features to Clang lit tests and use them to exclude tests with large stack usage from UBSan bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217064 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Index/annotate-deep-statements.cpp | 4 ++-- test/Index/index-many-call-ops.cpp | 3 +++ test/Index/index-many-logical-ops.c | 3 +++ test/lit.cfg | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/Index/annotate-deep-statements.cpp b/test/Index/annotate-deep-statements.cpp index c0a55f25e4..1803c2bacf 100644 --- a/test/Index/annotate-deep-statements.cpp +++ b/test/Index/annotate-deep-statements.cpp @@ -3,8 +3,8 @@ // rdar://11979525 // Check that we don't get stack overflow trying to annotate an extremely deep AST. -// AddressSanitizer increases stack usage. -// REQUIRES: not_asan +// AddressSanitizer and UndefinedBehaviorSanitizer increases stack usage. +// REQUIRES: not_asan, not_ubsan struct S { S &operator()(); diff --git a/test/Index/index-many-call-ops.cpp b/test/Index/index-many-call-ops.cpp index e732b5f188..7644697d4e 100644 --- a/test/Index/index-many-call-ops.cpp +++ b/test/Index/index-many-call-ops.cpp @@ -4,6 +4,9 @@ // Check that we don't get stack overflow trying to index a huge number of // call operators. +// UBSan increses stack usage. +// REQUIRES: not_ubsan + struct S { S &operator()(); }; diff --git a/test/Index/index-many-logical-ops.c b/test/Index/index-many-logical-ops.c index 67017decb7..0fd4e75236 100644 --- a/test/Index/index-many-logical-ops.c +++ b/test/Index/index-many-logical-ops.c @@ -4,6 +4,9 @@ // Check that we don't get stack overflow trying to index a huge number of // logical operators. +// UBSan increses stack usage. +// REQUIRES: not_ubsan + // CHECK: [indexDeclaration]: kind: function | name: foo int foo(int x) { return diff --git a/test/lit.cfg b/test/lit.cfg index 2d946c5a65..64570d763a 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -450,6 +450,10 @@ else: if (config.llvm_use_sanitizer == "Memory" or config.llvm_use_sanitizer == "MemoryWithOrigins"): config.available_features.add("msan") +if config.llvm_use_sanitizer == "Undefined": + config.available_features.add("ubsan") +else: + config.available_features.add("not_ubsan") # Check if we should run long running tests. if lit_config.params.get("run_long_tests", None) == "true": -- 2.40.0