[llvm-commits] [llvm-gcc-4.2] r106690 - in /llvm-gcc-4.2/trunk/gcc: c-cppbuiltin.c testsuite/gcc.apple/tls-1.c
Eric Christopher
echristo at apple.com
Wed Jun 23 15:30:09 PDT 2010
Author: echristo
Date: Wed Jun 23 17:30:09 2010
New Revision: 106690
URL: http://llvm.org/viewvc/llvm-project?rev=106690&view=rev
Log:
Add a preprocessor definition if we have TLS enabled. And a test.
Added:
llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c
Modified:
llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c
Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c?rev=106690&r1=106689&r2=106690&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Wed Jun 23 17:30:09 2010
@@ -639,6 +639,11 @@
if (flag_openmp)
cpp_define (pfile, "_OPENMP=200505");
+ /* LLVM LOCAL begin tls */
+ if (targetm.have_tls)
+ cpp_define (pfile, "__HAS_TLS__");
+ /* LLVM LOCAL end tls */
+
/* A straightforward target hook doesn't work, because of problems
linking that hook's body when part of non-C front ends. */
# define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM)
Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c?rev=106690&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c Wed Jun 23 17:30:09 2010
@@ -0,0 +1,8 @@
+/* Make sure we're emitting the __HAS_TLS__ symbol if we have tls. */
+/* { dg-require-effective-target tls } */
+
+#ifdef __HAS_TLS__
+extern __thread int a;
+#else
+#error "No TLS!"
+#endif
More information about the llvm-commits
mailing list