Check asm input and output expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44289 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/asm.c b/test/Sema/asm.c
new file mode 100644
index 0000000..e01a0f2
--- /dev/null
+++ b/test/Sema/asm.c
@@ -0,0 +1,14 @@
+// RUN: clang %s -verify -fsyntax-only
+
+void
+f()
+{
+  int i;
+
+  asm ("foo\n" : : "a" (i + 2));
+  asm ("foo\n" : : "a" (f())); // expected-error {{invalid type 'void' in asm input}}
+  
+  asm ("foo\n" : "=a" (f())); // expected-error {{invalid lvalue in asm output}}
+  asm ("foo\n" : "=a" (i + 2)); // expected-error {{invalid lvalue in asm output}}
+  
+}