<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:10pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 10pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hello</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I think, because this is a unit-test, the compile will happen for the host (x86_64 in this case). So the binary will still be x86_64.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The compile that the test runs will pick up whatever the default target triple is <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">(hexagon
 for the bot, aarch64 for us)</span>. I don't know a lot about these tests, but I presume that somewhere deep within <span>testStructuralMatch or <span>makeNamedDecls it will be picking this up and we can override it?</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span><span><br>
</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span><span>..</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span><span><br>
</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-size: 10pt;">Looking at it now, I think the Args to </span><span style="font-size: 10pt;">buildASTFromCodeWithArgs will allow specific targets to be used. I'm not sure the best way to get that information
 through to there, but something like this would work:</span><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span style="font-size: 10pt;"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-size: 10pt;"></span></p>
<div>diff --git a/unittests/AST/StructuralEquivalenceTest.cpp b/unittests/AST/StructuralEquivalenceTest.c</div>
<div>index e6c289a..52dba5e 100644</div>
<div>--- a/unittests/AST/StructuralEquivalenceTest.cpp</div>
<div>+++ b/unittests/AST/StructuralEquivalenceTest.cpp</div>
<div>@@ -28,6 +28,7 @@ struct StructuralEquivalenceTest : ::testing::Test {</div>
<div>     this->Code0 = SrcCode0;</div>
<div>     this->Code1 = SrcCode1;</div>
<div>     ArgVector Args = getBasicRunOptionsForLanguage(Lang);</div>
<div>+    Args.push_back("--target=x86_64-unknown-linux-gnu");</div>
<div> </div>
<div>     const char *const InputFileName = "input.cc";</div>
<div> </div>
<div><br>
</div>
I wouldn't recommend that, exactly, it would needlessly reduce the testing on other targets. And I think for the hexagon target the x86 backend will not even be registered I believe. Perhaps just something like this from another ASTMatchesNode test, to try
 and capture the same intent as the ifdefs:</div>
<div id="divtagdefaultwrapper" style="font-size: 10pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-size: 10pt;"><span>TEST_F(StructuralEquivalenceFunctionTest, FunctionsWithDifferentSavedRegsAttr) {</span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-size: 10pt;"></span></p>
<div>
<div>  if (llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArch() != llvm::Triple::x86_64)</div>
<div>    return;</div>
<div>  ...</div>
</div>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span><span><span></span></span></span></p>
<p style="margin-top:0;margin-bottom:0"><span><span><br>
</span></span></p>
<p style="margin-top:0;margin-bottom:0"><span><span>Dave</span></span></p>
<br>
<br>
<div style="color: rgb(0, 0, 0);"><br>
<div id="divRplyFwdMsg" dir="ltr">
<div></div>
</div>
<div>
<div dir="auto">> Hi,
<div dir="auto"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span><br>
</div>
<div dir="auto"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span>Thank you for catching this. I thought
 that the macros like <span style="font-family:sans-serif">__x86_64__ are defined for the target. I just don't understand: If they are defined for the host,
<span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">
> </span>that would mean we can't cross compile on the same host for different targets, wouldn't it? </span></div>
<div dir="auto"><span style="font-family:sans-serif"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span><br>
</span></div>
<div dir="auto"><span style="font-family:sans-serif"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span>I
 couldn't find out which macros to use to get the target arch, so I see 2 possible solutions :</span></div>
<div dir="auto"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span>1. Create a new test binary for these
 two small tests and specify explicitly the target. This seems overwhelming. </div>
<div dir="auto"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span>2. Simply remove those two test cases.
 This seems to be the simplest solution. </div>
<div dir="auto"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span><br>
</div>
<div dir="auto"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 13.3333px;">> </span>Gábor </div>
<div class="x_gmail_quote" dir="auto"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>