summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/builtins-hexagon-v55.c17
-rw-r--r--clang/test/Sema/builtins-hexagon-v60.c16
-rw-r--r--clang/test/Sema/builtins-hexagon-v62.c15
-rw-r--r--clang/test/Sema/builtins-hexagon-v65.c15
-rw-r--r--clang/test/Sema/builtins-hvx-none.c26
-rw-r--r--clang/test/Sema/builtins-hvx-v60.c25
-rw-r--r--clang/test/Sema/builtins-hvx-v62.c24
-rw-r--r--clang/test/Sema/builtins-hvx-v65.c23
8 files changed, 161 insertions, 0 deletions
diff --git a/clang/test/Sema/builtins-hexagon-v55.c b/clang/test/Sema/builtins-hexagon-v55.c
new file mode 100644
index 00000000000..e5e233d1f1e
--- /dev/null
+++ b/clang/test/Sema/builtins-hexagon-v55.c
@@ -0,0 +1,17 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 %s -triple hexagon -fsyntax-only -verify -target-cpu hexagonv55
+
+unsigned builtin_needs_v60(unsigned Rs) {
+ // expected-error@+1 {{builtin is not supported on this CPU}}
+ return __builtin_HEXAGON_S6_rol_i_r(Rs, 3);
+}
+
+unsigned long long builtin_needs_v62(unsigned Rs) {
+ // expected-error@+1 {{builtin is not supported on this CPU}}
+ return __builtin_HEXAGON_S6_vsplatrbp(Rs);
+}
+
+unsigned builtin_needs_v65(unsigned long long Rss, unsigned long long Rtt) {
+ // expected-error@+1 {{builtin is not supported on this CPU}}
+ return __builtin_HEXAGON_A6_vcmpbeq_notany(Rss, Rtt);
+}
diff --git a/clang/test/Sema/builtins-hexagon-v60.c b/clang/test/Sema/builtins-hexagon-v60.c
new file mode 100644
index 00000000000..d4f081bf66a
--- /dev/null
+++ b/clang/test/Sema/builtins-hexagon-v60.c
@@ -0,0 +1,16 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 %s -triple hexagon -fsyntax-only -verify -target-cpu hexagonv60
+
+unsigned builtin_needs_v60(unsigned Rs) {
+ return __builtin_HEXAGON_S6_rol_i_r(Rs, 3);
+}
+
+unsigned long long builtin_needs_v62(unsigned Rs) {
+ // expected-error@+1 {{builtin is not supported on this CPU}}
+ return __builtin_HEXAGON_S6_vsplatrbp(Rs);
+}
+
+unsigned builtin_needs_v65(unsigned long long Rss, unsigned long long Rtt) {
+ // expected-error@+1 {{builtin is not supported on this CPU}}
+ return __builtin_HEXAGON_A6_vcmpbeq_notany(Rss, Rtt);
+}
diff --git a/clang/test/Sema/builtins-hexagon-v62.c b/clang/test/Sema/builtins-hexagon-v62.c
new file mode 100644
index 00000000000..ed3907bc827
--- /dev/null
+++ b/clang/test/Sema/builtins-hexagon-v62.c
@@ -0,0 +1,15 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 %s -triple hexagon -fsyntax-only -verify -target-cpu hexagonv62
+
+unsigned builtin_needs_v60(unsigned Rs) {
+ return __builtin_HEXAGON_S6_rol_i_r(Rs, 3);
+}
+
+unsigned long long builtin_needs_v62(unsigned Rs) {
+ return __builtin_HEXAGON_S6_vsplatrbp(Rs);
+}
+
+unsigned builtin_needs_v65(unsigned long long Rss, unsigned long long Rtt) {
+ // expected-error@+1 {{builtin is not supported on this CPU}}
+ return __builtin_HEXAGON_A6_vcmpbeq_notany(Rss, Rtt);
+}
diff --git a/clang/test/Sema/builtins-hexagon-v65.c b/clang/test/Sema/builtins-hexagon-v65.c
new file mode 100644
index 00000000000..bb8a1ce5e16
--- /dev/null
+++ b/clang/test/Sema/builtins-hexagon-v65.c
@@ -0,0 +1,15 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 %s -triple hexagon -fsyntax-only -verify -target-cpu hexagonv65
+
+// expected-no-diagnostics
+unsigned builtin_needs_v60(unsigned Rs) {
+ return __builtin_HEXAGON_S6_rol_i_r(Rs, 3);
+}
+
+unsigned long long builtin_needs_v62(unsigned Rs) {
+ return __builtin_HEXAGON_S6_vsplatrbp(Rs);
+}
+
+unsigned builtin_needs_v65(unsigned long long Rss, unsigned long long Rtt) {
+ return __builtin_HEXAGON_A6_vcmpbeq_notany(Rss, Rtt);
+}
diff --git a/clang/test/Sema/builtins-hvx-none.c b/clang/test/Sema/builtins-hvx-none.c
new file mode 100644
index 00000000000..c43b34f1c57
--- /dev/null
+++ b/clang/test/Sema/builtins-hvx-none.c
@@ -0,0 +1,26 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 -triple hexagon %s -fsyntax-only -verify
+
+typedef long Vect1024 __attribute__((__vector_size__(128)))
+ __attribute__((aligned(128)));
+typedef long Vect2048 __attribute__((__vector_size__(256)))
+ __attribute__((aligned(128)));
+
+typedef Vect1024 HVX_Vector;
+typedef Vect2048 HVX_VectorPair;
+
+
+HVX_Vector builtin_needs_v60(HVX_VectorPair a) {
+ // expected-error@+1 {{builtin requires HVX}}
+ return __builtin_HEXAGON_V6_hi_128B(a);
+}
+
+HVX_Vector builtin_needs_v62(char a) {
+ // expected-error@+1 {{builtin requires HVX}}
+ return __builtin_HEXAGON_V6_lvsplatb_128B(a);
+}
+
+HVX_VectorPair builtin_needs_v65() {
+ // expected-error@+1 {{builtin requires HVX}}
+ return __builtin_HEXAGON_V6_vdd0_128B();
+}
diff --git a/clang/test/Sema/builtins-hvx-v60.c b/clang/test/Sema/builtins-hvx-v60.c
new file mode 100644
index 00000000000..7d298e989ea
--- /dev/null
+++ b/clang/test/Sema/builtins-hvx-v60.c
@@ -0,0 +1,25 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 -triple hexagon %s -target-feature +hvx-length128b -target-feature +hvxv60 -target-cpu hexagonv60 -fsyntax-only -verify
+
+typedef long Vect1024 __attribute__((__vector_size__(128)))
+ __attribute__((aligned(128)));
+typedef long Vect2048 __attribute__((__vector_size__(256)))
+ __attribute__((aligned(128)));
+
+typedef Vect1024 HVX_Vector;
+typedef Vect2048 HVX_VectorPair;
+
+
+HVX_Vector builtin_needs_v60(HVX_VectorPair a) {
+ return __builtin_HEXAGON_V6_hi_128B(a);
+}
+
+HVX_Vector builtin_needs_v62(char a) {
+ // expected-error@+1 {{builtin is not supported on this version of HVX}}
+ return __builtin_HEXAGON_V6_lvsplatb_128B(a);
+}
+
+HVX_VectorPair builtin_needs_v65() {
+ // expected-error@+1 {{builtin is not supported on this version of HVX}}
+ return __builtin_HEXAGON_V6_vdd0_128B();
+}
diff --git a/clang/test/Sema/builtins-hvx-v62.c b/clang/test/Sema/builtins-hvx-v62.c
new file mode 100644
index 00000000000..b73af963766
--- /dev/null
+++ b/clang/test/Sema/builtins-hvx-v62.c
@@ -0,0 +1,24 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 -triple hexagon %s -target-feature +hvx-length128b -target-feature +hvxv62 -target-cpu hexagonv62 -fsyntax-only -verify
+
+typedef long Vect1024 __attribute__((__vector_size__(128)))
+ __attribute__((aligned(128)));
+typedef long Vect2048 __attribute__((__vector_size__(256)))
+ __attribute__((aligned(128)));
+
+typedef Vect1024 HVX_Vector;
+typedef Vect2048 HVX_VectorPair;
+
+
+HVX_Vector builtin_needs_v60(HVX_VectorPair a) {
+ return __builtin_HEXAGON_V6_hi_128B(a);
+}
+
+HVX_Vector builtin_needs_v62(char a) {
+ return __builtin_HEXAGON_V6_lvsplatb_128B(a);
+}
+
+HVX_VectorPair builtin_needs_v65() {
+ // expected-error@+1 {{builtin is not supported on this version of HVX}}
+ return __builtin_HEXAGON_V6_vdd0_128B();
+}
diff --git a/clang/test/Sema/builtins-hvx-v65.c b/clang/test/Sema/builtins-hvx-v65.c
new file mode 100644
index 00000000000..be6b7b0955d
--- /dev/null
+++ b/clang/test/Sema/builtins-hvx-v65.c
@@ -0,0 +1,23 @@
+// REQUIRES: hexagon-registered-target
+// RUN: %clang_cc1 -triple hexagon %s -target-feature +hvx-length128b -target-feature +hvxv65 -target-cpu hexagonv65 -fsyntax-only -verify
+
+typedef long Vect1024 __attribute__((__vector_size__(128)))
+ __attribute__((aligned(128)));
+typedef long Vect2048 __attribute__((__vector_size__(256)))
+ __attribute__((aligned(128)));
+
+typedef Vect1024 HVX_Vector;
+typedef Vect2048 HVX_VectorPair;
+
+// expected-no-diagnostics
+HVX_Vector builtin_needs_v60(HVX_VectorPair a) {
+ return __builtin_HEXAGON_V6_hi_128B(a);
+}
+
+HVX_Vector builtin_needs_v62(char a) {
+ return __builtin_HEXAGON_V6_lvsplatb_128B(a);
+}
+
+HVX_VectorPair builtin_needs_v65() {
+ return __builtin_HEXAGON_V6_vdd0_128B();
+}
OpenPOWER on IntegriCloud