diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2015-11-18 00:15:28 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-11-18 00:15:28 +0000 |
commit | 66bf0e5936d767a8a3f441581a7b5d0f0842c7ba (patch) | |
tree | 57b5b72b5cf1d07c7b95a87c51602e77084e89a3 /test/OpenMP/atomic_capture_codegen.cpp | |
parent | c6ed134ddd583541954a050b4236681b12971b50 (diff) |
Produce a better diagnostic for global register variables.
Currently, when there is a global register variable in a program that
is bound to an invalid register, clang/llvm prints an error message that
is not very user-friendly.
This commit improves the diagnostic and moves the check that used to be
in the backend to Sema. In addition, it makes changes to error out if
the size of the register doesn't match the declared variable size.
e.g., volatile register int B asm ("rbp");
rdar://problem/23084219
Differential Revision: http://reviews.llvm.org/D13834
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253405 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/atomic_capture_codegen.cpp')
-rw-r--r-- | test/OpenMP/atomic_capture_codegen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/OpenMP/atomic_capture_codegen.cpp b/test/OpenMP/atomic_capture_codegen.cpp index 6dd9f7ab2a..f91da3e80f 100644 --- a/test/OpenMP/atomic_capture_codegen.cpp +++ b/test/OpenMP/atomic_capture_codegen.cpp @@ -72,7 +72,10 @@ struct BitFields4_packed { typedef float float2 __attribute__((ext_vector_type(2))); float2 float2x; -register int rix __asm__("0"); +// Register "0" is currently an invalid register for global register variables. +// Use "esp" instead of "0". +// register int rix __asm__("0"); +register int rix __asm__("esp"); int main() { // CHECK: [[PREV:%.+]] = atomicrmw add i8* @{{.+}}, i8 1 monotonic |