From 9a1024ba9dd53012a3fd49563ed0230cc7e75f75 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 18 Jul 2014 10:36:37 +0000 Subject: [PATCH] ARM: Add test for ACLE memory barrier intrinsics Add an additional test to ensure that someone doesn't accidentally change the definitions such that they can take a non-constant value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213364 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Sema/arm_acle.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/Sema/arm_acle.c b/test/Sema/arm_acle.c index 9a70f8514b..866626fc38 100644 --- a/test/Sema/arm_acle.c +++ b/test/Sema/arm_acle.c @@ -1,6 +1,22 @@ // RUN: %clang_cc1 -triple armv8 -target-cpu cortex-a57 -fsyntax-only -ffreestanding -verify %s #include +/* + * Memory barrier intrinsics + * Argument for dmb, dsb, isb must be compile-time constant, + * otherwise an error should be raised. + */ +void test_dmb_const_diag(const unsigned int t) { + return __dmb(t); // expected-error-re {{argument to {{.*}} must be a constant integer}} +} + +void test_dsb_const_diag(const unsigned int t) { + return __dsb(t); // expected-error-re {{argument to {{.*}} must be a constant integer}} +} + +void test_isb_const_diag(const unsigned int t) { + return __isb(t); // expected-error-re {{argument to {{.*}} must be a constant integer}} +} /* * Saturating intrinsics -- 2.40.0