<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">(+LLVM-dev)<div class=""><br class=""></div><div class="">Your datalayout is invalid.</div><div class=""><br class=""><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 22, 2016, at 10:18 PM, Varun Patil <<a href="mailto:varun.patil40@gmail.com" class="">varun.patil40@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Thank you for reply. <br class="">But again problem with test.bc file is as follows,<br class=""><b class="">COMMAND:</b><br class=""><b class="">$ ./llc -view-dag-combine1-dags -march=toy -relocation-model=pic -filetype=asm ~/test.bc <br class="">ERROR:<br class="">LLVM ERROR: not a number, or does not fit in an unsigned int</b><br class=""><br class=""></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><br class=""></div>Thanks and Regards<div class="">Varun</div></div></div></div></div></div>
<br class=""><div class="gmail_quote">On Fri, Sep 23, 2016 at 10:36 AM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Sep 22, 2016, at 9:57 PM, Varun Patil via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">Hi Developer,<br class=""><br class=""></div>I have wrote simple program called test.c as follows.<br class=""><b class="">int a, b;<br class="">int main() {<br class="">a=10;<br class="">b=10;<br class="">return a+b;<br class="">}</b><br class=""></div><br class="">Compiled with clang command to produce test.ll file which is attached below,<br class=""><b class="">$clang -cc1 test.c -emit-llvm</b><br clear="all" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""> Now If I want to run with my own target for selection with <b class="">llc</b> with command as follow getting error,<br class=""><b class="">COMMAND:<br class="">$ ./llc -view-dag-combine1-dags -march=toy -relocation-model=pic -filetype=asm ~/test.ll <br class="">ERROR:<br class="">./llc: /home/varun/test.ll:14:18: error: expected comma after load's type<br class="">  %2 = load i32* @a, align 4<br class=""></b></div></div></div></div></div></div></div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">The clang you’re using is not the same version as the llc you built.</div><div class="">It seems quite older.</div><div class="">You’ll be more successful with:</div><div class=""><br class=""></div><div class="">clang -c -emit-llvm test.c -o test.bc</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">— </div><span class="HOEnZb"><font color="#888888" class=""><div class="">Mehdi</div><div class=""><br class=""></div></font></span></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>