summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/target-features-error-2.c
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-11-12 00:44:12 +0000
committerEric Christopher <echristo@gmail.com>2015-11-12 00:44:12 +0000
commit2b2d56f059e75553eac0c1d172ef5b6e4278607f (patch)
tree3b1284a56de9e24db3c9ca43261af66459acf2cb /clang/test/CodeGen/target-features-error-2.c
parentfbfd97ed5c514ddf3bb79da0bd2cdb546e56abb1 (diff)
downloadbcm5719-llvm-2b2d56f059e75553eac0c1d172ef5b6e4278607f.tar.gz
bcm5719-llvm-2b2d56f059e75553eac0c1d172ef5b6e4278607f.zip
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
Diffstat (limited to 'clang/test/CodeGen/target-features-error-2.c')
-rw-r--r--clang/test/CodeGen/target-features-error-2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGen/target-features-error-2.c b/clang/test/CodeGen/target-features-error-2.c
new file mode 100644
index 00000000000..66b8a46a4df
--- /dev/null
+++ b/clang/test/CodeGen/target-features-error-2.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o -
+#define __MM_MALLOC_H
+#include <x86intrin.h>
+
+int baz(__m256i a) {
+ return _mm256_extract_epi32(a, 3); // expected-error {{function 'baz' and always_inline callee function '_mm256_extract_epi32' are required to have matching target features}}
+}
OpenPOWER on IntegriCloud