Index: flang/lib/Frontend/CompilerInstance.cpp =================================================================== --- flang/lib/Frontend/CompilerInstance.cpp +++ flang/lib/Frontend/CompilerInstance.cpp @@ -17,6 +17,7 @@ #include "flang/Parser/parsing.h" #include "flang/Parser/provenance.h" #include "flang/Semantics/semantics.h" +#include "llvm/ADT/Triple.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileSystem.h" @@ -143,6 +144,11 @@ bool CompilerInstance::executeAction(FrontendAction &act) { auto &invoc = this->getInvocation(); + llvm::Triple targetTriple{llvm::Triple(invoc.getTargetOpts().triple)}; + if (targetTriple.getArch() == llvm::Triple::ArchType::x86_64) { + invoc.getDefaultKinds().set_quadPrecisionKind(10); + } + // Set some sane defaults for the frontend. invoc.setDefaultFortranOpts(); // Update the fortran options based on user-based input. Index: flang/test/Semantics/kinds04_q10.f90 =================================================================== --- flang/test/Semantics/kinds04_q10.f90 +++ flang/test/Semantics/kinds04_q10.f90 @@ -1,4 +1,4 @@ -! RUN: %python %S/test_errors.py %s %flang_fc1 +! RUN: %python %S/test_errors.py %s %flang_fc1 -triple x86_64-unknown-linux-gnu ! C716 If both kind-param and exponent-letter appear, exponent-letter ! shall be E. (As an extension we also allow an exponent-letter which matches ! the kind-param) @@ -7,10 +7,8 @@ ! ! This test is for x86_64, where exponent-letter 'q' is for ! 10-byte extended precision -! REQUIRES: x86-registered-target ! UNSUPPORTED: system-windows -! XFAIL: * -!WARNING: THIS TEST HAS BEEN DISABLED UNTIL IT CAN BE PROPERLY CONFIGURED + subroutine s(var) real :: realvar1 = 4.0E6_4 real :: realvar2 = 4.0D6