Provide a frontend based error for always_inline functions that require
target features that the caller function doesn't provide. This matches
the existing backend failure to inline functions that don't have
matching target features - and diagnoses earlier in the case of
always_inline.

Fix up a few test cases that were, in fact, invalid if you tried
to generate code from the backend with the specified target features
and add a couple of tests to illustrate what's going on.

This should fix PR25246.

llvm-svn: 252834
diff --git a/clang/test/CodeGen/target-features-error.c b/clang/test/CodeGen/target-features-error.c
new file mode 100644
index 0000000..c7abbd0
--- /dev/null
+++ b/clang/test/CodeGen/target-features-error.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o -
+int __attribute__((target("avx"), always_inline)) foo(int a) {
+  return a + 4;
+}
+int bar() {
+  return foo(4); // expected-error {{function 'bar' and always_inline callee function 'foo' are required to have matching target features}}
+}
+