diff options
Diffstat (limited to 'clang/test/Sema/builtins-arm-exclusive-none.c')
| -rw-r--r-- | clang/test/Sema/builtins-arm-exclusive-none.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/clang/test/Sema/builtins-arm-exclusive-none.c b/clang/test/Sema/builtins-arm-exclusive-none.c index 76d327f..25a71e1 100644 --- a/clang/test/Sema/builtins-arm-exclusive-none.c +++ b/clang/test/Sema/builtins-arm-exclusive-none.c @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple armv6m -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple thumbv6m -fsyntax-only -verify %s // Armv6-M does not support exclusive loads/stores at all, so all uses of -// __builtin_arm_ldrex and __builtin_arm_strex is forbidden. +// __builtin_arm_ldrex[d] and __builtin_arm_strex[d] is forbidden. int test_ldrex(char *addr) { int sum = 0; @@ -20,3 +20,21 @@ int test_strex(char *addr) { res |= __builtin_arm_strex(42, (long long *)addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} return res; } + +int test_ldrexd(char *addr) { + int sum = 0; + sum += __builtin_arm_ldrexd(addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + sum += __builtin_arm_ldrexd((short *)addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + sum += __builtin_arm_ldrexd((int *)addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + sum += __builtin_arm_ldrexd((long long *)addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + return sum; +} + +int test_strexd(char *addr) { + int res = 0; + res |= __builtin_arm_strexd(4, addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + res |= __builtin_arm_strexd(42, (short *)addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + res |= __builtin_arm_strexd(42, (int *)addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + res |= __builtin_arm_strexd(42, (long long *)addr); // expected-error {{load and store exclusive builtins are not available on this architecture}} + return res; +} |
