summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/atomic_update_codegen.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2015-11-18 00:15:28 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2015-11-18 00:15:28 +0000
commit8c26ea663d433e7d9f51603d4e3170ef52eea2e5 (patch)
tree9b1ceab8c5842e7b12007c3ea65057261b85b49c /clang/test/OpenMP/atomic_update_codegen.cpp
parentcbf0b5e4b690c781c475c466a072d9d01fd71787 (diff)
downloadbcm5719-llvm-8c26ea663d433e7d9f51603d4e3170ef52eea2e5.tar.gz
bcm5719-llvm-8c26ea663d433e7d9f51603d4e3170ef52eea2e5.zip
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 llvm-svn: 253405
Diffstat (limited to 'clang/test/OpenMP/atomic_update_codegen.cpp')
-rw-r--r--clang/test/OpenMP/atomic_update_codegen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/test/OpenMP/atomic_update_codegen.cpp b/clang/test/OpenMP/atomic_update_codegen.cpp
index df8b538ee16..063b76d7ff5 100644
--- a/clang/test/OpenMP/atomic_update_codegen.cpp
+++ b/clang/test/OpenMP/atomic_update_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-NOT: atomicrmw
OpenPOWER on IntegriCloud