summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/self-comparison.c
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-01-07 22:18:05 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-01-07 22:18:05 +0000
commit07c0f285ba92148f5793959c386dc2ba8f0cc7f7 (patch)
tree964b85fb29ee7613ed394bb8fe656d16945b4e23 /clang/test/Sema/self-comparison.c
parente15bffe9ea8743182f70f18d1a8720c21d28be18 (diff)
downloadbcm5719-llvm-07c0f285ba92148f5793959c386dc2ba8f0cc7f7.tar.gz
bcm5719-llvm-07c0f285ba92148f5793959c386dc2ba8f0cc7f7.zip
Fix a couple of wrong self-comparison diagnostics.
Check whether we are comparing the same entity, not merely the same declaration, and don't assume that weak declarations resolve to distinct entities. llvm-svn: 321976
Diffstat (limited to 'clang/test/Sema/self-comparison.c')
-rw-r--r--clang/test/Sema/self-comparison.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Sema/self-comparison.c b/clang/test/Sema/self-comparison.c
index edb3a6a4c8a..bd7adcd9cda 100644
--- a/clang/test/Sema/self-comparison.c
+++ b/clang/test/Sema/self-comparison.c
@@ -86,3 +86,8 @@ int R8435950(int i) {
return 1;
}
+__attribute__((weak)) int weak_1[3];
+__attribute__((weak)) int weak_2[3];
+_Bool compare_weak() {
+ return weak_1 == weak_2;
+}
OpenPOWER on IntegriCloud