]> granicus.if.org Git - clang/commitdiff
Basic: fix handling for Windows Itanium environment
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 28 Jun 2014 23:34:11 +0000 (23:34 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 28 Jun 2014 23:34:11 +0000 (23:34 +0000)
This corrects the handling for i686-windows-itanium.  This environment is nearly
identical to Windows MSVC, except it uses the itanium ABI for C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211991 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/CodeGen/windows-itanium.c [new file with mode: 0644]

index 8312ff3d16ee1caab344ab3f30965aac95750cfb..dae4f767f877f35270085493b0114d465c68e112 100644 (file)
@@ -6301,6 +6301,7 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
         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);
       }
diff --git a/test/CodeGen/windows-itanium.c b/test/CodeGen/windows-itanium.c
new file mode 100644 (file)
index 0000000..7f0e7b1
--- /dev/null
@@ -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: }
+