Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libcxx] Enable '-fdelayed-template-parsing' for clang-cl libcxx tests #70092

Closed
wants to merge 1 commit into from

Conversation

zeroomega
Copy link
Contributor

This patch enables '-fdelayed-template-parsing' in clang-cl based libcxx
tests. This flag was disabled by default in PR#69431, which causes this
test to fail.

This patch enables '-fdelayed-template-parsing' in clang-cl based libcxx
tests. This flag was disabled by default in PR#69431, which causes this
test to fail.
@zeroomega zeroomega marked this pull request as ready for review October 24, 2023 23:44
@zeroomega zeroomega requested a review from a team as a code owner October 24, 2023 23:44
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Oct 24, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 24, 2023

@llvm/pr-subscribers-libcxx

Author: Haowei (zeroomega)

Changes

This patch enables '-fdelayed-template-parsing' in clang-cl based libcxx
tests. This flag was disabled by default in PR#69431, which causes this
test to fail.


Full diff: https://github.com/llvm/llvm-project/pull/70092.diff

2 Files Affected:

  • (modified) libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in (+1-1)
  • (modified) libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in (+3-1)
diff --git a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
index 50d28eb67c77b78..829f41cd5607c59 100644
--- a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
@@ -5,7 +5,7 @@ lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
 
 config.substitutions.append(('%{flags}', '--driver-mode=g++'))
 config.substitutions.append(('%{compile_flags}',
-    '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
+    '-fms-runtime-lib=' + config.fms_runtime_lib + ' -fdelayed-template-parsing' + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
 ))
 config.substitutions.append(('%{link_flags}',
     '-nostdlib -L %{lib} -lc++ -l' + config.cxx_lib
diff --git a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
index 4baaad765a92d38..8c643081d8c152c 100644
--- a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
@@ -4,8 +4,10 @@
 lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
 
 config.substitutions.append(('%{flags}', '--driver-mode=g++'))
+# clang-cl by default disabled '-fdelayed-template-parsing'. Explicitly enable
+# it here for tests.
 config.substitutions.append(('%{compile_flags}',
-    '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
+    '-fms-runtime-lib=' + config.fms_runtime_lib + ' -fdelayed-template-parsing' + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
 ))
 config.substitutions.append(('%{link_flags}',
     '-nostdlib -L %{lib} -llibc++ -l' + config.cxx_lib

@EricWF
Copy link
Member

EricWF commented Oct 25, 2023

If I recall correctly -fdelayed-template-parsing puts the compiler into a non-conforming mode. And MSVC now defaults to -fno-delayed-template-parsing now.

Does libc++ want to support a non-conforming, legacy, MSVC extension?

@petrhosek
Copy link
Member

In #69431 @ChuanqiXu9 suggested enabling -fdelayed-template-parsing to address the failing issues although I think it'd be better to address the issues. I think that addressing #70223 should be fairly straightforward but I don't know about #70225.

@EricWF
Copy link
Member

EricWF commented Oct 25, 2023

Since there's already an issue for the failure, I would be OK XFAIL'ing the failing test. Would you like me to send the PR?

@ldionne
Copy link
Member

ldionne commented Oct 26, 2023

Since there's already an issue for the failure, I would be OK XFAIL'ing the failing test. Would you like me to send the PR?

Yeah, same here. I would rather not be building the tests with non-standard arguments.

@petrhosek
Copy link
Member

I sent #70422 which XFAIL's the affected tests.

@ldionne
Copy link
Member

ldionne commented Oct 27, 2023

Thanks @petrhosek, I'll close this then.

@ldionne ldionne closed this Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. test-suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants