<div dir="ltr">Even after all the fixup attempts, there's still a failing clang-tools-extra test:<div><br></div><div>ninja: Entering directory `out/gn'<br>[0/2] ACTION //clang-tools-extra/test:check-clang-tools(//llvm/utils/gn/build/toolchain:unix)<br>-- Testing: 787 tests, 64 threads --<br>Testing: 0 .. 10<br>FAIL: Clang Tools :: clang-tidy/clang-tidy-__clang_analyzer__macro.cpp (112 of 787)<br>******************** TEST 'Clang Tools :: clang-tidy/clang-tidy-__clang_analyzer__macro.cpp' FAILED ********************<br>Script:<br>--<br>: 'RUN: at line 1'; clang-tidy /usr/local/google/home/thakis/src/llvm-project/clang-tools-extra/test/clang-tidy/clang-tidy-__clang_analyzer__macro.cpp -checks=-*,modernize-use-nullptr -- | count 0<br>--<br>Exit Code: 1<br><br>Command Output (stderr):<br>--<br>1 error generated.<br>Error while processing /usr/local/google/home/thakis/src/llvm-project/clang-tools-extra/test/clang-tidy/clang-tidy-__clang_analyzer__macro.cpp.<br>Found compiler error(s).<br>Expected 0 lines, got 3.<br><br>--<br><br>********************<br>Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. <br>Testing Time: 4.11s<br>********************<br>Failing Tests (1):<br> Clang Tools :: clang-tidy/clang-tidy-__clang_analyzer__macro.cpp<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 23, 2019 at 8:31 PM Jan Korous via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: jkorous<br>
Date: Mon Sep 23 17:33:47 2019<br>
New Revision: 372679<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=372679&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=372679&view=rev</a><br>
Log:<br>
[static analyzer] Define __clang_analyzer__ macro in driver<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D67938" rel="noreferrer" target="_blank">https://reviews.llvm.org/D67938</a><br>
<br>
Added:<br>
cfe/trunk/test/Analysis/misc-driver.c<br>
Modified:<br>
cfe/trunk/lib/Driver/ToolChains/Clang.cpp<br>
cfe/trunk/lib/Frontend/InitPreprocessor.cpp<br>
cfe/trunk/test/Analysis/misc-ps.m<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=372679&r1=372678&r2=372679&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=372679&r1=372678&r2=372679&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Mon Sep 23 17:33:47 2019<br>
@@ -3896,8 +3896,10 @@ void Clang::ConstructJob(Compilation &C,<br>
if (Args.hasArg(options::OPT_municode))<br>
CmdArgs.push_back("-DUNICODE");<br>
<br>
- if (isa<AnalyzeJobAction>(JA))<br>
+ if (isa<AnalyzeJobAction>(JA)) {<br>
RenderAnalyzerOptions(Args, CmdArgs, Triple, Input);<br>
+ CmdArgs.push_back("-D__clang_analyzer__");<br>
+ }<br>
<br>
// Enable compatilibily mode to avoid analyzer-config related errors.<br>
// Since we can't access frontend flags through hasArg, let's manually iterate<br>
<br>
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=372679&r1=372678&r2=372679&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=372679&r1=372678&r2=372679&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Mon Sep 23 17:33:47 2019<br>
@@ -990,10 +990,6 @@ static void InitializePredefinedMacros(c<br>
else if (LangOpts.getStackProtector() == LangOptions::SSPReq)<br>
Builder.defineMacro("__SSP_ALL__", "3");<br>
<br>
- // Define a macro that exists only when using the static analyzer.<br>
- if (FEOpts.ProgramAction == frontend::RunAnalysis)<br>
- Builder.defineMacro("__clang_analyzer__");<br>
-<br>
if (LangOpts.FastRelaxedMath)<br>
Builder.defineMacro("__FAST_RELAXED_MATH__");<br>
<br>
<br>
Added: cfe/trunk/test/Analysis/misc-driver.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-driver.c?rev=372679&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-driver.c?rev=372679&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Analysis/misc-driver.c (added)<br>
+++ cfe/trunk/test/Analysis/misc-driver.c Mon Sep 23 17:33:47 2019<br>
@@ -0,0 +1,5 @@<br>
+// RUN: %clang --analyze %s<br>
+<br>
+#ifndef __clang_analyzer__<br>
+#error __clang_analyzer__ not defined<br>
+#endif<br>
<br>
Modified: cfe/trunk/test/Analysis/misc-ps.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=372679&r1=372678&r2=372679&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=372679&r1=372678&r2=372679&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Analysis/misc-ps.m (original)<br>
+++ cfe/trunk/test/Analysis/misc-ps.m Mon Sep 23 17:33:47 2019<br>
@@ -2,10 +2,6 @@<br>
// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s<br>
// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s<br>
<br>
-#ifndef __clang_analyzer__<br>
-#error __clang_analyzer__ not defined<br>
-#endif<br>
-<br>
typedef struct objc_ivar *Ivar;<br>
typedef struct objc_selector *SEL;<br>
typedef signed char BOOL;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>