summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-06-23 21:47:46 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-06-23 21:47:46 +0000
commit248c719a6879d31fcdec760d46b8b50ec2d8761e (patch)
treee60c679f9cad19f9b1a5276736d19db58528f84b /clang/test
parent4a75be24c98b2e285229160d41319c685d32797b (diff)
downloadbcm5719-llvm-248c719a6879d31fcdec760d46b8b50ec2d8761e.tar.gz
bcm5719-llvm-248c719a6879d31fcdec760d46b8b50ec2d8761e.zip
Patch fixes an obscure bug when 'used' attribute is applied to
variables in ObjC's Next runtime mode. Next runtime also implicitly applies 'used' attribute on some of its meta-data. This results in two 'llvm.used' arrays to be generated, and one of them is renamed to 'llvm.used1'. llvm-svn: 74008
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenObjC/deadcode_strip_used_var.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/deadcode_strip_used_var.m b/clang/test/CodeGenObjC/deadcode_strip_used_var.m
new file mode 100644
index 00000000000..444cf766f7d
--- /dev/null
+++ b/clang/test/CodeGenObjC/deadcode_strip_used_var.m
@@ -0,0 +1,9 @@
+// RUN: clang-cc %s -emit-llvm -o %t -triple i386-apple-darwin10 &&
+// RUN: grep "llvm.used" %t | count 1 &&
+// RUN: clang-cc %s -emit-llvm -o %t -triple x86_64-apple-darwin10 &&
+// RUN: grep "llvm.used" %t | count 1
+
+
+__attribute__((used)) static int XXXXXX __attribute__ ((section ("__DATA,__Xinterpose"))) ;
+__attribute__((used)) static int YYYY __attribute__ ((section ("__DATA,__Xinterpose"))) ;
+
OpenPOWER on IntegriCloud