[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/76246

>From fe2406d5fb6c01db9efadc9107c94585a6051c8a Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 20 Dec 2023 20:43:38 +0100
Subject: [PATCH] [libc++][modules] Adds module testing.

This adds a new module test infrastructure. This requires tagging tests
using modules. The test runner uses this information to determine the
compiler flags needed to build and use the module.

Currently modules are build per test, which allows testing them for
tests with ADDITIONAL_COMPILE_FLAGS. At the moment only 4 tests use
modules. Therefore the performance penalty is not measurable. If in the
future more tests use modules it would be good to measure the overhead
and determine whether it's acceptable.
---
 libcxx/test/libcxx/module_std.gen.py  |  3 +-
 libcxx/test/libcxx/module_std_compat.gen.py   |  3 +-
 .../libcxx/selftest/modules/no-modules.sh.cpp | 12 +++
 .../modules/std-and-std.compat-module.sh.cpp  | 23 ++
 .../libcxx/selftest/modules/std-module.sh.cpp | 25 +++
 .../selftest/modules/std.compat-module.sh.cpp | 25 +++
 .../modules/unknown-module.compile.pass.cpp   | 13 
 libcxx/test/std/modules/std.compat.pass.cpp   |  5 +-
 libcxx/test/std/modules/std.pass.cpp  |  5 +-
 libcxx/utils/libcxx/test/features.py  | 13 
 libcxx/utils/libcxx/test/format.py| 73 +--
 libcxx/utils/libcxx/test/modules.py   |  5 +-
 12 files changed, 194 insertions(+), 11 deletions(-)
 create mode 100644 libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/unknown-module.compile.pass.cpp

diff --git a/libcxx/test/libcxx/module_std.gen.py 
b/libcxx/test/libcxx/module_std.gen.py
index 8e03d6e5b5b523..3ad2aff9d085f4 100644
--- a/libcxx/test/libcxx/module_std.gen.py
+++ b/libcxx/test/libcxx/module_std.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std",
 )
 
 
diff --git a/libcxx/test/libcxx/module_std_compat.gen.py 
b/libcxx/test/libcxx/module_std_compat.gen.py
index c4792db3d71e62..63fdd8188937e1 100644
--- a/libcxx/test/libcxx/module_std_compat.gen.py
+++ b/libcxx/test/libcxx/module_std_compat.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std.compat",
 )
 
 
diff --git a/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
new file mode 100644
index 00..86d0afc13e3c40
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
@@ -0,0 +1,12 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// Make sure that the module flags are empty when no module is supplied.
+
+// MODULES:
+// RUN: echo "%{module_flags}"  | grep "^$"
diff --git 
a/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
new file mode 100644
index 00..da9497f2dbb768
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+// UNSUPPORTED: clang-modules-build
+// UNSUPPORTED: gcc
+
+// XFAIL: has-no-module-support
+
+// Make sure that the module flags contain the expected elements.
+// The tests only look for the expected components and not the exact flags.
+// Otherwise changing the location of the module breaks this test.
+
+// MODULES: std std.compat
+//
+// RUN: echo "%{module_flags}" | grep -- "-fprebuilt-module-path="
+// RUN: echo "%{module_flags}" | grep "std.pcm"
+// RUN: echo "%{module_flags}" | grep "std.compat.pcm"
diff --git a/libcxx/test/libcxx/selftest/modules/std-module.sh.cpp 
b/libcxx/test/libcxx/se

[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)

2023-12-23 Thread Nikolas Klauser via llvm-branch-commits

https://github.com/philnik777 requested changes to this pull request.

I'm really not happy with bumping the clang-tidy version we use all the time to 
the trunk version. We agreed to using the latest stable version, which we've 
not done way too many times now. I'd really like to first understand what 
exactly the issue is that is solved by bumping the version again.

https://github.com/llvm/llvm-project/pull/76268
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

mordante wrote:

> If you are okay with the suggestions that I made for some typos in the 
> documentation, I will preemptively incorporate it into my documentation PR.

Thanks for the suggestions! Please do no incorporate these in your PR. Other 
reviewers may have other suggestions which you then need to incorporate too. 
It's a lot easier, for both of us, when you finish the documentation PR and 
after you merged your branch I move the comments of this patch to the new 
location. I left this comment for other reviewers so they don't need to comment 
on it. This is how we typically resolve conflicts between patches.

> I really like how you integrated module testing so nicely.

Thanks!

https://github.com/llvm/llvm-project/pull/76246
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/76246

>From fe2406d5fb6c01db9efadc9107c94585a6051c8a Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 20 Dec 2023 20:43:38 +0100
Subject: [PATCH 1/2] [libc++][modules] Adds module testing.

This adds a new module test infrastructure. This requires tagging tests
using modules. The test runner uses this information to determine the
compiler flags needed to build and use the module.

Currently modules are build per test, which allows testing them for
tests with ADDITIONAL_COMPILE_FLAGS. At the moment only 4 tests use
modules. Therefore the performance penalty is not measurable. If in the
future more tests use modules it would be good to measure the overhead
and determine whether it's acceptable.
---
 libcxx/test/libcxx/module_std.gen.py  |  3 +-
 libcxx/test/libcxx/module_std_compat.gen.py   |  3 +-
 .../libcxx/selftest/modules/no-modules.sh.cpp | 12 +++
 .../modules/std-and-std.compat-module.sh.cpp  | 23 ++
 .../libcxx/selftest/modules/std-module.sh.cpp | 25 +++
 .../selftest/modules/std.compat-module.sh.cpp | 25 +++
 .../modules/unknown-module.compile.pass.cpp   | 13 
 libcxx/test/std/modules/std.compat.pass.cpp   |  5 +-
 libcxx/test/std/modules/std.pass.cpp  |  5 +-
 libcxx/utils/libcxx/test/features.py  | 13 
 libcxx/utils/libcxx/test/format.py| 73 +--
 libcxx/utils/libcxx/test/modules.py   |  5 +-
 12 files changed, 194 insertions(+), 11 deletions(-)
 create mode 100644 libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/unknown-module.compile.pass.cpp

diff --git a/libcxx/test/libcxx/module_std.gen.py 
b/libcxx/test/libcxx/module_std.gen.py
index 8e03d6e5b5b523..3ad2aff9d085f4 100644
--- a/libcxx/test/libcxx/module_std.gen.py
+++ b/libcxx/test/libcxx/module_std.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std",
 )
 
 
diff --git a/libcxx/test/libcxx/module_std_compat.gen.py 
b/libcxx/test/libcxx/module_std_compat.gen.py
index c4792db3d71e62..63fdd8188937e1 100644
--- a/libcxx/test/libcxx/module_std_compat.gen.py
+++ b/libcxx/test/libcxx/module_std_compat.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std.compat",
 )
 
 
diff --git a/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
new file mode 100644
index 00..86d0afc13e3c40
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
@@ -0,0 +1,12 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// Make sure that the module flags are empty when no module is supplied.
+
+// MODULES:
+// RUN: echo "%{module_flags}"  | grep "^$"
diff --git 
a/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
new file mode 100644
index 00..da9497f2dbb768
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+// UNSUPPORTED: clang-modules-build
+// UNSUPPORTED: gcc
+
+// XFAIL: has-no-module-support
+
+// Make sure that the module flags contain the expected elements.
+// The tests only look for the expected components and not the exact flags.
+// Otherwise changing the location of the module breaks this test.
+
+// MODULES: std std.compat
+//
+// RUN: echo "%{module_flags}" | grep -- "-fprebuilt-module-path="
+// RUN: echo "%{module_flags}" | grep "std.pcm"
+// RUN: echo "%{module_flags}" | grep "std.compat.pcm"
diff --git a/libcxx/test/libcxx/selftest/modules/std-module.sh.cpp 
b/libcxx/test/libcx

[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/76246

>From fe2406d5fb6c01db9efadc9107c94585a6051c8a Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 20 Dec 2023 20:43:38 +0100
Subject: [PATCH 1/3] [libc++][modules] Adds module testing.

This adds a new module test infrastructure. This requires tagging tests
using modules. The test runner uses this information to determine the
compiler flags needed to build and use the module.

Currently modules are build per test, which allows testing them for
tests with ADDITIONAL_COMPILE_FLAGS. At the moment only 4 tests use
modules. Therefore the performance penalty is not measurable. If in the
future more tests use modules it would be good to measure the overhead
and determine whether it's acceptable.
---
 libcxx/test/libcxx/module_std.gen.py  |  3 +-
 libcxx/test/libcxx/module_std_compat.gen.py   |  3 +-
 .../libcxx/selftest/modules/no-modules.sh.cpp | 12 +++
 .../modules/std-and-std.compat-module.sh.cpp  | 23 ++
 .../libcxx/selftest/modules/std-module.sh.cpp | 25 +++
 .../selftest/modules/std.compat-module.sh.cpp | 25 +++
 .../modules/unknown-module.compile.pass.cpp   | 13 
 libcxx/test/std/modules/std.compat.pass.cpp   |  5 +-
 libcxx/test/std/modules/std.pass.cpp  |  5 +-
 libcxx/utils/libcxx/test/features.py  | 13 
 libcxx/utils/libcxx/test/format.py| 73 +--
 libcxx/utils/libcxx/test/modules.py   |  5 +-
 12 files changed, 194 insertions(+), 11 deletions(-)
 create mode 100644 libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/unknown-module.compile.pass.cpp

diff --git a/libcxx/test/libcxx/module_std.gen.py 
b/libcxx/test/libcxx/module_std.gen.py
index 8e03d6e5b5b523..3ad2aff9d085f4 100644
--- a/libcxx/test/libcxx/module_std.gen.py
+++ b/libcxx/test/libcxx/module_std.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std",
 )
 
 
diff --git a/libcxx/test/libcxx/module_std_compat.gen.py 
b/libcxx/test/libcxx/module_std_compat.gen.py
index c4792db3d71e62..63fdd8188937e1 100644
--- a/libcxx/test/libcxx/module_std_compat.gen.py
+++ b/libcxx/test/libcxx/module_std_compat.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std.compat",
 )
 
 
diff --git a/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
new file mode 100644
index 00..86d0afc13e3c40
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
@@ -0,0 +1,12 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// Make sure that the module flags are empty when no module is supplied.
+
+// MODULES:
+// RUN: echo "%{module_flags}"  | grep "^$"
diff --git 
a/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
new file mode 100644
index 00..da9497f2dbb768
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+// UNSUPPORTED: clang-modules-build
+// UNSUPPORTED: gcc
+
+// XFAIL: has-no-module-support
+
+// Make sure that the module flags contain the expected elements.
+// The tests only look for the expected components and not the exact flags.
+// Otherwise changing the location of the module breaks this test.
+
+// MODULES: std std.compat
+//
+// RUN: echo "%{module_flags}" | grep -- "-fprebuilt-module-path="
+// RUN: echo "%{module_flags}" | grep "std.pcm"
+// RUN: echo "%{module_flags}" | grep "std.compat.pcm"
diff --git a/libcxx/test/libcxx/selftest/modules/std-module.sh.cpp 
b/libcxx/test/libcx

[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/76246

>From fe2406d5fb6c01db9efadc9107c94585a6051c8a Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 20 Dec 2023 20:43:38 +0100
Subject: [PATCH 1/4] [libc++][modules] Adds module testing.

This adds a new module test infrastructure. This requires tagging tests
using modules. The test runner uses this information to determine the
compiler flags needed to build and use the module.

Currently modules are build per test, which allows testing them for
tests with ADDITIONAL_COMPILE_FLAGS. At the moment only 4 tests use
modules. Therefore the performance penalty is not measurable. If in the
future more tests use modules it would be good to measure the overhead
and determine whether it's acceptable.
---
 libcxx/test/libcxx/module_std.gen.py  |  3 +-
 libcxx/test/libcxx/module_std_compat.gen.py   |  3 +-
 .../libcxx/selftest/modules/no-modules.sh.cpp | 12 +++
 .../modules/std-and-std.compat-module.sh.cpp  | 23 ++
 .../libcxx/selftest/modules/std-module.sh.cpp | 25 +++
 .../selftest/modules/std.compat-module.sh.cpp | 25 +++
 .../modules/unknown-module.compile.pass.cpp   | 13 
 libcxx/test/std/modules/std.compat.pass.cpp   |  5 +-
 libcxx/test/std/modules/std.pass.cpp  |  5 +-
 libcxx/utils/libcxx/test/features.py  | 13 
 libcxx/utils/libcxx/test/format.py| 73 +--
 libcxx/utils/libcxx/test/modules.py   |  5 +-
 12 files changed, 194 insertions(+), 11 deletions(-)
 create mode 100644 libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std-module.sh.cpp
 create mode 100644 libcxx/test/libcxx/selftest/modules/std.compat-module.sh.cpp
 create mode 100644 
libcxx/test/libcxx/selftest/modules/unknown-module.compile.pass.cpp

diff --git a/libcxx/test/libcxx/module_std.gen.py 
b/libcxx/test/libcxx/module_std.gen.py
index 8e03d6e5b5b523..3ad2aff9d085f4 100644
--- a/libcxx/test/libcxx/module_std.gen.py
+++ b/libcxx/test/libcxx/module_std.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std",
 )
 
 
diff --git a/libcxx/test/libcxx/module_std_compat.gen.py 
b/libcxx/test/libcxx/module_std_compat.gen.py
index c4792db3d71e62..63fdd8188937e1 100644
--- a/libcxx/test/libcxx/module_std_compat.gen.py
+++ b/libcxx/test/libcxx/module_std_compat.gen.py
@@ -29,7 +29,8 @@
 "%{clang-tidy}",
 "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
 "%{cxx}",
-"%{flags} %{compile_flags}",
+"%{flags} %{compile_flags} %{module_flags}",
+"std.compat",
 )
 
 
diff --git a/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
new file mode 100644
index 00..86d0afc13e3c40
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/no-modules.sh.cpp
@@ -0,0 +1,12 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// Make sure that the module flags are empty when no module is supplied.
+
+// MODULES:
+// RUN: echo "%{module_flags}"  | grep "^$"
diff --git 
a/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp 
b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
new file mode 100644
index 00..da9497f2dbb768
--- /dev/null
+++ b/libcxx/test/libcxx/selftest/modules/std-and-std.compat-module.sh.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+// UNSUPPORTED: clang-modules-build
+// UNSUPPORTED: gcc
+
+// XFAIL: has-no-module-support
+
+// Make sure that the module flags contain the expected elements.
+// The tests only look for the expected components and not the exact flags.
+// Otherwise changing the location of the module breaks this test.
+
+// MODULES: std std.compat
+//
+// RUN: echo "%{module_flags}" | grep -- "-fprebuilt-module-path="
+// RUN: echo "%{module_flags}" | grep "std.pcm"
+// RUN: echo "%{module_flags}" | grep "std.compat.pcm"
diff --git a/libcxx/test/libcxx/selftest/modules/std-module.sh.cpp 
b/libcxx/test/libcx

[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/76268

>From 10dcb9404ac63bd1c10936e60f21159e7eabe38b Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Fri, 22 Dec 2023 21:43:57 +0100
Subject: [PATCH] [libc++][modules] Increase clang-tidy version used.

As suggested in #71438 we should use
  export import std;
in the std.compat module.

Testing this locally failed when building with the clang-tidy-17
plugin. The std module was considered corrupt in the test
  libcxx/test/libcxx/module_std_compat.gen.py
however the test
  libcxx/test/libcxx/module_std.gen.py
passed. Both test generated identical std.pcm files. Using the
clang-tidy-18 plugin solves the issue.
---
 libcxx/test/tools/clang_tidy_checks/CMakeLists.txt | 4 ++--
 libcxx/utils/libcxx/test/features.py   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt 
b/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
index 260e90f45f577c..978e7095216522 100644
--- a/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
+++ b/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
@@ -5,9 +5,9 @@
 set(LLVM_DIR_SAVE ${LLVM_DIR})
 set(Clang_DIR_SAVE ${Clang_DIR})
 
-find_package(Clang 17)
+find_package(Clang 18)
 if (NOT Clang_FOUND)
-  find_package(Clang 18)
+  find_package(Clang 17)
 endif()
 
 set(SOURCES
diff --git a/libcxx/utils/libcxx/test/features.py 
b/libcxx/utils/libcxx/test/features.py
index 1939d553d72dc1..36e3ff13700b8c 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -31,8 +31,8 @@ def _getSuitableClangTidy(cfg):
 return None
 
 # TODO MODULES require ToT due module specific fixes.
-if runScriptExitCode(cfg, ['clang-tidy-17 --version']) == 0:
-  return 'clang-tidy-17'
+if runScriptExitCode(cfg, ['clang-tidy-18 --version']) == 0:
+  return 'clang-tidy-18'
 
 # TODO This should be the last stable release.
 # LLVM RELEASE bump to latest stable version

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

mordante wrote:

> I'm really not happy with bumping the clang-tidy version we use all the time 
> to the trunk version. We agreed to using the latest stable version, which 
> we've not done way too many times now. I'd really like to first understand 
> what exactly the issue is that is solved by bumping the version again.

I'm also not too happy that we need to bump it, but the newest version has 
fixes I need. That patch will be 2 patches from now in this stacked review. I 
think the description of the review is clear what the issue is. Can you tell 
what's not clear?

https://github.com/llvm/llvm-project/pull/76268
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)

2023-12-23 Thread Nikolas Klauser via llvm-branch-commits

philnik777 wrote:

I'd like to understand what the fixed issues are you're relying on. From what I 
can tell, this could just as much be a bug in our setup for the clang-tidy 
plugin as an actual fix in trunk.

https://github.com/llvm/llvm-project/pull/76268
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2023-12-23 Thread Will Hawkins via llvm-branch-commits

hawkinsw wrote:

> > If you are okay with the suggestions that I made for some typos in the 
> > documentation, I will preemptively incorporate it into my documentation PR.
> 
> Thanks for the suggestions! Please do no incorporate these in your PR. Other 
> reviewers may have other suggestions which you then need to incorporate too. 
> It's a lot easier, for both of us, when you finish the documentation PR and 
> after you merged your branch I move the comments of this patch to the new 
> location. I left this comment for other reviewers so they don't need to 
> comment on it. This is how we typically resolve conflicts between patches.
> 

That makes total sense. I had already added the following to my PR (in case you 
are interested in incorporating here):

```
 - ``// MODULE: [std|std.compat]+``
 - A test containing the ``MODULE`` libc++-specific Lit directive will be 
built with support for importing the
   `C++23 Standard Library Modules 
`_  
``std`` and/or ``std.compat``, depending on whether one or both
   is specified in the space-separated list. In addition to the compiler 
flags necessary to build the test with support for the standard libraries, a 
test that contains this
   directive will be compiled with flags from the ``%{module_flags}`` 
substitution.
```

but I will gladly revert that if you think it's a good idea. 

Sorry for the confusion -- just trying to be helpful!

> > I really like how you integrated module testing so nicely.
> 
> Thanks!



https://github.com/llvm/llvm-project/pull/76246
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Fixes clang-tidy exports. (PR #76288)

2023-12-23 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante created 
https://github.com/llvm/llvm-project/pull/76288

As suggested in #71438 we should use
  export import std;
in the std.compat module.

Using this exports some named declarations from functions and records, adding 
them to the global namespace. Clang correctly, does not export these it's and 
issue in the declaration filtering. Declarations in function or record context 
are not considered a global named declaration.

>From dd147d317c4a1d0f9f98113106c630a1feec4320 Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Sat, 23 Dec 2023 15:27:43 +0100
Subject: [PATCH] [libc++][modules] Fixes clang-tidy exports.

As suggested in #71438 we should use
  export import std;
in the std.compat module.

Using this exports some named declarations from functions and records,
adding them to the global namespace. Clang correctly, does not export
these it's and issue in the declaration filtering. Declarations in
function or record context are not considered a global named
declaration.
---
 .../clang_tidy_checks/header_exportable_declarations.cpp| 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp 
b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
index 35f020da45c435..15d2e6839ad5e3 100644
--- a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
+++ b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
@@ -252,9 +252,13 @@ static bool 
is_global_name_exported_by_std_module(std::string_view name) {
 
 static bool is_valid_declaration_context(
 const clang::NamedDecl& decl, std::string_view name, 
header_exportable_declarations::FileType file_type) {
-  if (decl.getDeclContext()->isNamespace())
+  const clang::DeclContext& context = *decl.getDeclContext();
+  if (context.isNamespace())
 return true;
 
+  if (context.isFunctionOrMethod() || context.isRecord())
+return false;
+
   if (is_global_name_exported_by_std_module(name))
 return true;
 

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Fixes clang-tidy exports. (PR #76288)

2023-12-23 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)


Changes

As suggested in #71438 we should use
  export import std;
in the std.compat module.

Using this exports some named declarations from functions and records, adding 
them to the global namespace. Clang correctly, does not export these it's and 
issue in the declaration filtering. Declarations in function or record context 
are not considered a global named declaration.

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


1 Files Affected:

- (modified) 
libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp (+5-1) 


``diff
diff --git 
a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp 
b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
index 35f020da45c435..15d2e6839ad5e3 100644
--- a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
+++ b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
@@ -252,9 +252,13 @@ static bool 
is_global_name_exported_by_std_module(std::string_view name) {
 
 static bool is_valid_declaration_context(
 const clang::NamedDecl& decl, std::string_view name, 
header_exportable_declarations::FileType file_type) {
-  if (decl.getDeclContext()->isNamespace())
+  const clang::DeclContext& context = *decl.getDeclContext();
+  if (context.isNamespace())
 return true;
 
+  if (context.isFunctionOrMethod() || context.isRecord())
+return false;
+
   if (is_global_name_exported_by_std_module(name))
 return true;
 

``




https://github.com/llvm/llvm-project/pull/76288
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [ci] Set timeout for individual tests and report slowest tests (PR #76300)

2023-12-23 Thread Vitaly Buka via llvm-branch-commits

https://github.com/vitalybuka created 
https://github.com/llvm/llvm-project/pull/76300

There are builds like
https://buildkite.com/llvm-project/github-pull-requests/builds/24894

It looks like a deadlock in a test, but we can't see which one.
`--timeout=` will make lit kill and report such tests.

`--time-tests` produces nice report about slowest test, so we can tune
them over time.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [llvm] [ci] Set timeout for individual tests and report slowest tests (PR #76300)

2023-12-23 Thread Vitaly Buka via llvm-branch-commits

https://github.com/vitalybuka edited 
https://github.com/llvm/llvm-project/pull/76300
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits