summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2019-07-31 12:52:17 +0000
committerMomchil Velikov <momchil.velikov@arm.com>2019-07-31 12:52:17 +0000
commita36d31478c182903523e04eb271bbf102bfab2cc (patch)
tree539202f6d2252095f3a51767560e7bdf1753db98 /clang/test/Sema
parent10dd2965b74d294f2b588e155f2faca8bf27cc74 (diff)
downloadbcm5719-llvm-a36d31478c182903523e04eb271bbf102bfab2cc.tar.gz
bcm5719-llvm-a36d31478c182903523e04eb271bbf102bfab2cc.zip
[AArch64] Add support for Transactional Memory Extension (TME)
Re-commit r366322 after some fixes TME is a future architecture technology, documented in https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools https://developer.arm.com/docs/ddi0601/a More about the future architectures: https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture This patch adds support for the TME instructions TSTART, TTEST, TCOMMIT, and TCANCEL and the target feature/arch extension "tme". It also implements TME builtin functions, defined in ACLE Q2 2019 (https://developer.arm.com/docs/101028/latest) Differential Revision: https://reviews.llvm.org/D64416 Patch by Javed Absar and Momchil Velikov llvm-svn: 367428
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/aarch64-tme-errors.c8
-rw-r--r--clang/test/Sema/aarch64-tme-tcancel-errors.c9
2 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Sema/aarch64-tme-errors.c b/clang/test/Sema/aarch64-tme-errors.c
new file mode 100644
index 00000000000..0e9c2a6beec
--- /dev/null
+++ b/clang/test/Sema/aarch64-tme-errors.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple aarch64-eabi -verify %s
+
+#include "arm_acle.h"
+
+void test_no_tme_funcs() {
+ __tstart(); // expected-warning{{implicit declaration of function '__tstart'}}
+ __builtin_tstart(); // expected-error{{use of unknown builtin '__builtin_tstart'}}
+}
diff --git a/clang/test/Sema/aarch64-tme-tcancel-errors.c b/clang/test/Sema/aarch64-tme-tcancel-errors.c
new file mode 100644
index 00000000000..bd5b7170a99
--- /dev/null
+++ b/clang/test/Sema/aarch64-tme-tcancel-errors.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple aarch64-eabi -target-feature +tme -verify %s
+void t_cancel_const(unsigned short u) {
+ __builtin_arm_tcancel(u); // expected-error{{argument to '__builtin_arm_tcancel' must be a constant integer}}
+}
+
+// RUN: %clang_cc1 -triple aarch64-eabi -target-feature +tme -verify %s
+void t_cancel_range() {
+ __builtin_arm_tcancel(0x12345u); // expected-error{{argument value 74565 is outside the valid range [0, 65535]}}
+}
OpenPOWER on IntegriCloud