summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-02-13 06:04:48 +0000
committerCraig Topper <craig.topper@gmail.com>2015-02-13 06:04:48 +0000
commit8dd7d0d9c17aa37eabaf6a0cd4f1c82cdb810000 (patch)
treead82b41ad647194d7358d88f3f89821adc9b97b0 /clang/test
parenta462482d98f8652504fa2f3964312d1b06d565db (diff)
downloadbcm5719-llvm-8dd7d0d9c17aa37eabaf6a0cd4f1c82cdb810000.tar.gz
bcm5719-llvm-8dd7d0d9c17aa37eabaf6a0cd4f1c82cdb810000.zip
[X86] Add range checking on immediate arguments on XOP vpcom builtins.
llvm-svn: 229067
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/builtins-x86.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/Sema/builtins-x86.c b/clang/test/Sema/builtins-x86.c
index 71004e1e2ba..326d2a3a7a1 100644
--- a/clang/test/Sema/builtins-x86.c
+++ b/clang/test/Sema/builtins-x86.c
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
+typedef long long __m128i __attribute__((__vector_size__(16)));
typedef float __m128 __attribute__((__vector_size__(16)));
typedef double __m128d __attribute__((__vector_size__(16)));
@@ -32,3 +33,35 @@ __mmask16 test__builtin_ia32_cmpps512_mask(__m512d __a, __m512d __b) {
__mmask8 test__builtin_ia32_cmppd512_mask(__m512d __a, __m512d __b) {
__builtin_ia32_cmppd512_mask(__a, __b, 32, -1, 0); // expected-error {{argument should be a value from 0 to 31}}
}
+
+__m128i test__builtin_ia32_vpcomub(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomub(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
+
+__m128i test__builtin_ia32_vpcomuw(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomuw(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
+
+__m128i test__builtin_ia32_vpcomud(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomud(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
+
+__m128i test__builtin_ia32_vpcomuq(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomuq(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
+
+__m128i test__builtin_ia32_vpcomb(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomub(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
+
+__m128i test__builtin_ia32_vpcomw(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomuw(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
+
+__m128i test__builtin_ia32_vpcomd(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomud(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
+
+__m128i test__builtin_ia32_vpcomq(__m128i __a, __m128i __b) {
+ __builtin_ia32_vpcomuq(__a, __b, 8); // expected-error {{argument should be a value from 0 to 7}}
+}
OpenPOWER on IntegriCloud