Author: Jan Patrick Lehr Date: 2025-05-07T22:36:11+02:00 New Revision: 5d4eb70a744f5fd78541c3506179f1d6d394292d
URL: https://github.com/llvm/llvm-project/commit/5d4eb70a744f5fd78541c3506179f1d6d394292d DIFF: https://github.com/llvm/llvm-project/commit/5d4eb70a744f5fd78541c3506179f1d6d394292d.diff LOG: Revert "[Driver] Reject -mcmodel=tiny on X86 (#125643)" This reverts commit c53e583007738f591d0c9993f06b65c4898a04f8. Added: Modified: clang/lib/Driver/ToolChains/CommonArgs.cpp clang/test/Driver/mcmodel.c Removed: ################################################################################ diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp index 5c1bc090810a2..8fbffa071634c 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -2938,7 +2938,8 @@ void tools::addMCModel(const Driver &D, const llvm::opt::ArgList &Args, Ok = CM == "small" || CM == "medium" || (CM == "large" && Triple.isRISCV64()); } else if (Triple.getArch() == llvm::Triple::x86_64) { - Ok = llvm::is_contained({"small", "kernel", "medium", "large"}, CM); + Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"}, + CM); } else if (Triple.isNVPTX() || Triple.isAMDGPU() || Triple.isSPIRV()) { // NVPTX/AMDGPU/SPIRV does not care about the code model and will accept // whatever works for the host. diff --git a/clang/test/Driver/mcmodel.c b/clang/test/Driver/mcmodel.c index 51c2effb56ad4..c6c8b5433d23b 100644 --- a/clang/test/Driver/mcmodel.c +++ b/clang/test/Driver/mcmodel.c @@ -1,5 +1,5 @@ // RUN: not %clang -### -c --target=i686 -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=ERR-MEDIUM %s -// RUN: not %clang --target=x86_64 -### -c -mcmodel=tiny %s 2>&1 | FileCheck --check-prefix=ERR-TINY %s +// RUN: %clang --target=x86_64 -### -c -mcmodel=tiny %s 2>&1 | FileCheck --check-prefix=TINY %s // RUN: %clang --target=x86_64 -### -c -mcmodel=small %s 2>&1 | FileCheck --check-prefix=SMALL %s // RUN: %clang --target=x86_64 -### -S -mcmodel=kernel %s 2>&1 | FileCheck --check-prefix=KERNEL %s // RUN: %clang --target=x86_64 -### -c -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=MEDIUM %s _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits