r181867 - Use correct types for SPARC v9.
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue May 14 20:22:33 PDT 2013
Author: stoklund
Date: Tue May 14 22:22:33 2013
New Revision: 181867
URL: http://llvm.org/viewvc/llvm-project?rev=181867&view=rev
Log:
Use correct types for SPARC v9.
It's an LP64 platform.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/init.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=181867&r1=181866&r2=181867&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue May 14 22:22:33 2013
@@ -4304,6 +4304,11 @@ public:
// FIXME: Support Sparc quad-precision long double?
DescriptionString = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
"i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32:64-S128";
+ // This is an LP64 platform.
+ LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
+ IntMaxType = SignedLong;
+ UIntMaxType = UnsignedLong;
+ Int64Type = SignedLong;
}
virtual void getTargetDefines(const LangOptions &Opts,
Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=181867&r1=181866&r2=181867&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Tue May 14 22:22:33 2013
@@ -2688,6 +2688,14 @@
// X86_64-LINUX:#define __x86_64 1
// X86_64-LINUX:#define __x86_64__ 1
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc64-none-none < /dev/null | FileCheck -check-prefix SPARCV9 %s
+// SPARCV9:#define __INTMAX_TYPE__ long int
+// SPARCV9:#define __INTPTR_TYPE__ long int
+// SPARCV9:#define __LONG_MAX__ 9223372036854775807L
+// SPARCV9:#define __LP64__ 1
+// SPARCV9:#define __SIZEOF_LONG__ 8
+// SPARCV9:#define __SIZEOF_POINTER__ 8
+//
// RUN: %clang_cc1 -x c++ -triple i686-pc-linux-gnu -fobjc-runtime=gcc -E -dM < /dev/null | FileCheck -check-prefix GNUSOURCE %s
// GNUSOURCE:#define _GNU_SOURCE 1
//
More information about the cfe-commits
mailing list