[cfe-commits] r161520 - in /cfe/trunk: lib/Sema/SemaStmt.cpp test/CodeGen/ms-inline-asm.c
Bill Wendling
wendling at apple.com
Wed Aug 8 14:39:10 PDT 2012
On Aug 8, 2012, at 1:37 PM, Chad Rosier <mcrosier at apple.com> wrote:
> Author: mcrosier
> Date: Wed Aug 8 15:37:31 2012
> New Revision: 161520
>
> URL: http://llvm.org/viewvc/llvm-project?rev=161520&view=rev
> Log:
> [ms-inline asm] Add a very simple test case. Basically, we're only testing for
> crashers at the moment (and coincidentally this case was causing a crash).
>
> Added:
> cfe/trunk/test/CodeGen/ms-inline-asm.c
> Modified:
> cfe/trunk/lib/Sema/SemaStmt.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=161520&r1=161519&r2=161520&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Aug 8 15:37:31 2012
> @@ -2786,6 +2786,9 @@
> SourceLocation AsmLoc,
> ArrayRef<Token> AsmToks,
> const TargetInfo &TI) {
> + if (!AsmToks.size())
Shouldn't these be "AsmToks.empty()" instead?
-bw
> + return "";
> +
> std::string Res;
> IdentifierInfo *II = AsmToks[0].getIdentifierInfo();
> Res = II->getName().str();
> @@ -2841,6 +2844,9 @@
> static std::string buildMSAsmString(Sema &SemaRef,
> ArrayRef<Token> AsmToks,
> ArrayRef<unsigned> LineEnds) {
> + if (!AsmToks.size())
> + return "";
> +
> // Collect the tokens into a string
> SmallString<512> Asm;
> SmallString<512> TokenBuf;
>
> Added: cfe/trunk/test/CodeGen/ms-inline-asm.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.c?rev=161520&view=auto
> ==============================================================================
> --- cfe/trunk/test/CodeGen/ms-inline-asm.c (added)
> +++ cfe/trunk/test/CodeGen/ms-inline-asm.c Wed Aug 8 15:37:31 2012
> @@ -0,0 +1,7 @@
> +// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -O0 -fms-extensions -w -emit-llvm -o - | FileCheck %s
> +
> +void t1() {
> +// CHECK: @t1
> +// CHECK: ret void
> + __asm {}
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list