Author: mstorsjo Date: Mon Aug 6 12:48:44 2018 New Revision: 339048 URL: http://llvm.org/viewvc/llvm-project?rev=339048&view=rev Log: [MinGW] Predefine UNICODE if -municode is specified during compilation
Differential Revision: https://reviews.llvm.org/D50199 Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp cfe/trunk/test/Driver/mingw.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=339048&r1=339047&r2=339048&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Mon Aug 6 12:48:44 2018 @@ -3346,6 +3346,9 @@ void Clang::ConstructJob(Compilation &C, if (Args.hasArg(options::OPT_static)) CmdArgs.push_back("-static-define"); + if (Args.hasArg(options::OPT_municode)) + CmdArgs.push_back("-DUNICODE"); + if (isa<AnalyzeJobAction>(JA)) RenderAnalyzerOptions(Args, CmdArgs, Triple, Input); Modified: cfe/trunk/test/Driver/mingw.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mingw.cpp?rev=339048&r1=339047&r2=339048&view=diff ============================================================================== --- cfe/trunk/test/Driver/mingw.cpp (original) +++ cfe/trunk/test/Driver/mingw.cpp Mon Aug 6 12:48:44 2018 @@ -56,3 +56,8 @@ // CHECK_MINGW_UBUNTU_POSIX_TREE: "{{.*}}/Inputs/mingw_ubuntu_posix_tree/usr{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}x86_64-w64-mingw32" // CHECK_MINGW_UBUNTU_POSIX_TREE: "{{.*}}/Inputs/mingw_ubuntu_posix_tree/usr{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}5.3-posix{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}backward" // CHECK_MINGW_UBUNTU_POSIX_TREE: "{{.*}}/Inputs/mingw_ubuntu_posix_tree/usr{{/|\\\\}}x86_64-w64-mingw32{{/|\\\\}}include" + +// RUN: %clang -target i686-windows-gnu -E -### %s 2>&1 | FileCheck -check-prefix=CHECK_MINGW_NO_UNICODE %s +// RUN: %clang -target i686-windows-gnu -E -### %s -municode 2>&1 | FileCheck -check-prefix=CHECK_MINGW_UNICODE %s +// CHECK_MINGW_NO_UNICODE-NOT: "-DUNICODE" +// CHECK_MINGW_UNICODE: "-DUNICODE" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits