Eli~<div><br></div><div>I am interested in clang development and this seemed like an easy enough bug to start with so I thought I would try it out.  I have managed to get llvm checked out and building without problems.  I found the tests and have turned the above example into a test in a new file `test/SemaCXX/inner-pod-struct.cpp`.</div>

<div><br></div><div>Unfortunately, I cannot figure out how to use lit.py properly.  I have looked at</div><div><br></div><div><a href="http://clang.llvm.org/hacking.html#testingNonWindows">http://clang.llvm.org/hacking.html#testingNonWindows</a></div>

<div><br></div><div>but am a bit confused as it refers to non-existant files in several places.  In particular,</div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div><div><div>python (path to llvm)\llvm\utils\lit\lit.py -sv</div>

</div><div><div>  --param=build_mode=Win32 --param=build_config=Debug</div></div><div><div>  --param=clang_site_config=(build dir)\tools\clang\test\lit.site.cfg</div></div><div><div>  (path to llvm)\llvm\tools\clang\test\(dir)\(test)</div>

</div></blockquote></div><div><br></div><div>is giving me trouble.  On my machine, ~/dev/llvm is the llvm checkout and ~/dev/llvm-build is the build dir.</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">

<div><div>boots@eiji:~/dev/llvm-build$ find . -name lit.site.cfg</div></div><div><div>boots@eiji:~/dev/llvm-build$ </div></div></blockquote><div><br></div><div>Kind of a bust there, what about the llvm dir?</div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">

<div><br></div><div><div>boots@eiji:~/dev/llvm$ find . -name lit.site.cfg</div></div><div><div>./utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.site.cfg</div></div><div><div>./utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg</div>

</div><div><div>./utils/lit/lit/ExampleTests.ObjDir/lit.site.cfg</div></div></blockquote></div><div><br></div><div>Something at least.</div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div>

<div><div>boots@eiji:~/dev/llvm-build$ python ~/dev/llvm/utils/lit/lit.py --param=clang_site_config=../llvm/./utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg /Users/boots/dev/llvm/tools/clang/test/</div></div>

<div><div>-- Testing: 1 tests, 4 threads --</div></div><div><div>PASS: LLVM :: Foo/pct-S.ll (1 of 1)</div></div><div><div>Testing Time: 0.28s</div></div><div><div>  Expected Passes    : 1</div></div></blockquote></div><div>

<br></div><div>But wait, that ran entirely the wrong tests?</div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div><div><div>boots@eiji:~/dev/llvm$ find . -name pct-S.ll</div></div><div><div>

./utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/pct-S.ll</div></div></blockquote></div><div><br></div><div>... Time passes while I hack and compose this email ...</div><div><br></div><div>I discover that:</div><div>

<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div><div>boots@eiji:~/dev/llvm-build$ cd tools/clang/</div><div><div>boots@eiji:~/dev/llvm-build/tools/clang$ make test </div></div><div><div>Making Clang 'lit.site.cfg' file...</div>

</div><div><div>Making Clang 'Unit/lit.site.cfg' file...</div></div><div><div>oots@eiji:~/dev/llvm-build/tools/clang/test$ python ~/dev/llvm/utils/lit/lit.py --param=clang_site_config=lit.site.cfg ~/dev/llvm/tools/clang/test/SemaCXX/inner-pod-struct.cpp </div>

</div><div><div>lit.py: lit.cfg:175: note: using clang: '/Users/boots/dev/llvm-build/Release+Asserts/bin/clang'</div></div><div><div>-- Testing: 1 tests, 4 threads --</div></div><div><div>FAIL: Clang :: SemaCXX/inner-pod-struct.cpp (1 of 1)</div>

</div><div><div>Testing Time: 0.28s</div></div><div><div>********************</div></div><div><div>Failing Tests (1):</div></div><div><div>    Clang :: SemaCXX/inner-pod-struct.cpp</div></div><div><div><br></div></div><div>

<div>  Unexpected Failures: 1</div></div></blockquote></div><div><br></div><div>Is the incantation I need.</div><div><br></div><div>Can we expand the testing page slightly to include mention that you have to run `make test` in the build/tools/clang directory to generate the cfg files?</div>

<div><br></div><div>Thanks,</div><div>Matt</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Tue, Apr 10, 2012 at 9:04 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Apr 10, 2012 at 5:37 PM, Guillaume Marcais<br>
<<a href="mailto:guillaume.marcais@marcais.net">guillaume.marcais@marcais.net</a>> wrote:<br>
> The following simple program creates a variable length array of structures:<br>
><br>
> //template<typename T><br>
> class Test {<br>
> public:<br>
>  struct toto {<br>
>    int* x;<br>
>  };<br>
><br>
>  void method(int nb) {<br>
>    toto ary[nb];<br>
>    for(int i = 0; i < nb; ++i)<br>
>      ary[i].x = 0;<br>
>  }<br>
> };<br>
><br>
><br>
> int main(int argc, char* argv[]) {<br>
>  //Test<char> t;<br>
>  Test t;<br>
>  t.method(5);<br>
><br>
>  return 0;<br>
> }<br>
><br>
> In compiles properly as written with clang++ (version 3.0). When<br>
> uncommeting the templated version, then the compiler complains:<br>
><br>
> POD.cc:9:13: error: variable length array of non-POD element type<br>
> 'Test<char>::toto'<br>
>    toto ary[nb];<br>
><br>
> It does not seem right. 'struct toto' still looks like a POD. Why<br>
> isn't it one anymore?<br>
><br>
> As a side note, g++ compiles this code without complaining.<br>
<br>
</div></div>Looks like a bug; please file at <a href="http://llvm.org/bugs/" target="_blank">llvm.org/bugs/</a> .<br>
<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>