<div>Hi,</div>
<div> </div>
<div>Clang crashes when tried to compile from .ast to .s for below sample code,</div>
<div> </div>
<div>inline-test.c</div>
<div><em></em> </div>
<div><em>extern inline int func1 (void) { return 0; }<br>inline int func1 (void) { return 1; }</em></div>
<div> </div>
<div>clang <strong>works fine</strong> for .c -> .s, </div>
<div><strong>>clang inline-test.c -std=c99 -fgnu89-inline -S -o inline-test.s </strong></div>
<div> </div>
<div>But <strong>crashes</strong> when tried to generate .s from .ast for same file, </div>
<div><strong>>clang inline-test.c -std=c99 -fgnu89-inline -emit-ast -o inline-test.ast</strong></div>
<div><strong>>clang inline-test.ast -std=c99 -fgnu89-inline -S -o inline-test.s</strong> </div>
<div> </div>
<div>clang-3.2: $HOME/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:342: void clang::CodeGen::CodeGenFunction::<strong>StartFunction</strong>(clang::GlobalDecl, clang::QualType, llvm::Function*, const clang::CodeGen::CGFunctionInfo&, const clang::CodeGen::FunctionArgList&, clang::SourceLocation): Assertion `<strong>CurFn->isDeclaration() && "Function already has body?"</strong>' failed.</div>
<div> </div>
<div>From crash message it seems Codegen is already emitted for inline function.</div>
<div> </div>
<div>Crash occurs only if tried to generate assembly out of ast file.</div>
<div> </div>
<div> </div>
<div>Regards,</div>
<div>Rajesh</div>
<div> </div>
<div> </div>
<div> </div>