From 4fd1047140ad542fc8a11d370d102d19171c81ed Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 28 Jun 2014 23:34:11 +0000 Subject: [PATCH] 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++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211991 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets.cpp | 1 + test/CodeGen/windows-itanium.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/CodeGen/windows-itanium.c diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 8312ff3d16..dae4f767f8 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -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 index 0000000000..7f0e7b135d --- /dev/null +++ b/test/CodeGen/windows-itanium.c @@ -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: } + -- 2.40.0