From: Saleem Abdulrasool Date: Tue, 20 Mar 2018 17:33:26 +0000 (+0000) Subject: Basic: support PreserveMost and PreserveAll on Windows ARM X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=082d99b513573b5c14619c8fa3a9ef8f324fe498;p=clang Basic: support PreserveMost and PreserveAll on Windows ARM Do not ignore these calling conventions on Windows ARM. They are used by the swift runtime for certain calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328007 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets/ARM.cpp b/lib/Basic/Targets/ARM.cpp index e946558759..736c235745 100644 --- a/lib/Basic/Targets/ARM.cpp +++ b/lib/Basic/Targets/ARM.cpp @@ -971,6 +971,8 @@ WindowsARMTargetInfo::checkCallingConvention(CallingConv CC) const { return CCCR_Ignore; case CC_C: case CC_OpenCLKernel: + case CC_PreserveMost: + case CC_PreserveAll: return CCCR_OK; default: return CCCR_Warning; diff --git a/test/CodeGen/preserve-call-conv.c b/test/CodeGen/preserve-call-conv.c index 2dff34e62d..7a84fa2823 100644 --- a/test/CodeGen/preserve-call-conv.c +++ b/test/CodeGen/preserve-call-conv.c @@ -3,6 +3,7 @@ // RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s // Check that the preserve_most calling convention attribute at the source level // is lowered to the corresponding calling convention attrribute at the LLVM IR diff --git a/test/Sema/preserve-call-conv.c b/test/Sema/preserve-call-conv.c index 6bd049ffdc..6add3095c6 100644 --- a/test/Sema/preserve-call-conv.c +++ b/test/Sema/preserve-call-conv.c @@ -2,6 +2,7 @@ // RUN: %clang_cc1 %s -fsyntax-only -triple arm64-unknown-unknown -verify // RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-windows-msvc -verify // RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-unknown-windows-msvc -verify +// RUN: %clang_cc1 %s -fsyntax-only -triple thumbv7-unknown-windows-msvc -verify typedef void typedef_fun_t(int);