r211991 - Basic: fix handling for Windows Itanium environment
Saleem Abdulrasool
compnerd at compnerd.org
Sat Jun 28 16:34:11 PDT 2014
Author: compnerd
Date: Sat Jun 28 18:34:11 2014
New Revision: 211991
URL: http://llvm.org/viewvc/llvm-project?rev=211991&view=rev
Log:
Basic: fix handling for Windows Itanium environment
This corrects the handling for i686-windows-itanium. This environment is nearly
identical to Windows MSVC, except it uses the itanium ABI for C++.
Added:
cfe/trunk/test/CodeGen/windows-itanium.c
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=211991&r1=211990&r2=211991&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sat Jun 28 18:34:11 2014
@@ -6301,6 +6301,7 @@ static TargetInfo *AllocateTarget(const
return new CygwinX86_32TargetInfo(Triple);
case llvm::Triple::GNU:
return new MinGWX86_32TargetInfo(Triple);
+ case llvm::Triple::Itanium:
case llvm::Triple::MSVC:
return new MicrosoftX86_32TargetInfo(Triple);
}
Added: cfe/trunk/test/CodeGen/windows-itanium.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/windows-itanium.c?rev=211991&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/windows-itanium.c (added)
+++ cfe/trunk/test/CodeGen/windows-itanium.c Sat Jun 28 18:34:11 2014
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple i686-windows-itanium -emit-llvm %s -o - \
+// RUN: | FileCheck %s -check-prefix CHECK-C -check-prefix CHECK
+
+// RUN: %clang_cc1 -triple i686-windows-itanium -emit-llvm -x c++ %s -o - \
+// RUN: | FileCheck %s -check-prefix CHECK-CXX -check-prefix CHECK
+
+int function() {
+ return 32;
+}
+
+// CHECK-C: define i32 @function() {{.*}} {
+// CHECK-CXX: define i32 @_Z8functionv() {{.*}} {
+// CHECK: ret i32 32
+// CHECK: }
+
More information about the cfe-commits
mailing list