* c-parser.c (c_parser_asm_statement): Skip until close paren and
return if c_parser_asm_string_literal returned NULL.
* gcc.dg/pr37772.c: New test.
* g++.dg/ext/asm11.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145401
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37772
+ * c-parser.c (c_parser_asm_statement): Skip until close paren and
+ return if c_parser_asm_string_literal returned NULL.
+
2009-04-01 Nick Clifton <nickc@redhat.com>
* config/m32c/m32c.h (LIBGCC2_UNITS_PER_WORD): Define if not
return NULL_TREE;
}
str = c_parser_asm_string_literal (parser);
+ if (str == NULL_TREE)
+ {
+ parser->lex_untranslated_string = false;
+ c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
+ return NULL_TREE;
+ }
if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN))
{
simple = true;
+2009-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37772
+ * gcc.dg/pr37772.c: New test.
+ * g++.dg/ext/asm11.C: New test.
+
2009-04-01 H.J. Lu <hongjiu.lu@intel.com>
- (restore_ld_library_path_env_vars): Always restore GCC_EXEC_PREFIX
- to its original value, or unset if it was not defined.
+ * lib/target-libpath.exp (restore_ld_library_path_env_vars): Always
+ restore GCC_EXEC_PREFIX to its original value, or unset if it was not
+ defined.
2009-03-31 Jason Merrill <jason@redhat.com>
--- /dev/null
+// PR c/37772
+// { dg-do compile }
+// { dg-options "" }
+
+void
+foo ()
+{
+ int i;
+ asm (); // { dg-error "expected string-literal before" }
+ asm (1); // { dg-error "expected string-literal before" }
+ asm (int); // { dg-error "expected string-literal before" }
+ asm (: "=r" (i)); // { dg-error "expected string-literal before" }
+ asm (1 : "=r" (i)); // { dg-error "expected string-literal before" }
+ asm (int : "=r" (i)); // { dg-error "expected string-literal before" }
+ asm (: : "r" (i)); // { dg-error "expected string-literal before" }
+ asm (1 : : "r" (i)); // { dg-error "expected string-literal before" }
+ asm (int : : "r" (i)); // { dg-error "expected string-literal before" }
+ asm (: : : "memory"); // { dg-error "expected string-literal before" }
+ asm (1 : : : "memory"); // { dg-error "expected string-literal before" }
+}
--- /dev/null
+/* PR c/37772 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo ()
+{
+ int i;
+ asm (); /* { dg-error "expected string literal before" } */
+ asm (1); /* { dg-error "expected string literal before" } */
+ asm (int); /* { dg-error "expected string literal before" } */
+ asm (: "=r" (i)); /* { dg-error "expected string literal before" } */
+ asm (1 : "=r" (i)); /* { dg-error "expected string literal before" } */
+ asm (int : "=r" (i)); /* { dg-error "expected string literal before" } */
+ asm (: : "r" (i)); /* { dg-error "expected string literal before" } */
+ asm (1 : : "r" (i)); /* { dg-error "expected string literal before" } */
+ asm (int : : "r" (i)); /* { dg-error "expected string literal before" } */
+ asm (: : : "memory"); /* { dg-error "expected string literal before" } */
+ asm (1 : : : "memory"); /* { dg-error "expected string literal before" } */
+}