From: Louis Dionne Date: Wed, 15 Apr 2020 16:58:00 +0000 (-0400) Subject: [libc++] Remove the need for the %{build_module} substitution X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e87c46b162632df0f962f05998d2e26bb78dac5d;p=platform%2Fupstream%2Fllvm.git [libc++] Remove the need for the %{build_module} substitution Instead of using .sh.cpp tests for the modules tests, use .compile.pass.cpp and add the -fmodules additional flag. --- diff --git a/libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp b/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp similarity index 90% rename from libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp rename to libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp index 135fb83..57a5ba5 100644 --- a/libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp @@ -15,16 +15,15 @@ // XFAIL: libcpp-has-no-threads // REQUIRES: modules-support +// ADDITIONAL_COMPILE_FLAGS: -fmodules // Test that re-exports -// RUN: %{build_module} - #include int main(int, char**) { - int8_t x; ((void)x); - std::int8_t y; ((void)y); + int8_t x; (void)x; + std::int8_t y; (void)y; return 0; } diff --git a/libcxx/test/libcxx/modules/clocale_exports.sh.cpp b/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp similarity index 81% rename from libcxx/test/libcxx/modules/clocale_exports.sh.cpp rename to libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp index 29086de..3b87b7b 100644 --- a/libcxx/test/libcxx/modules/clocale_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp @@ -14,20 +14,17 @@ // but still gets built as part of the 'std' module, which breaks the build. // XFAIL: libcpp-has-no-threads -// REQUIRES: modules-support // UNSUPPORTED: c++98, c++03 -// RUN: %{build_module} +// REQUIRES: modules-support +// ADDITIONAL_COMPILE_FLAGS: -fmodules #include -#define TEST(...) do { using T = decltype( __VA_ARGS__ ); } while(false) - int main(int, char**) { - std::lconv l; ((void)l); - - TEST(std::setlocale(0, "")); - TEST(std::localeconv()); + std::lconv l; (void)l; + using T = decltype(std::setlocale(0, "")); + using U = decltype(std::localeconv()); return 0; } diff --git a/libcxx/test/libcxx/modules/cstdint_exports.sh.cpp b/libcxx/test/libcxx/modules/cstdint_exports.compile.pass.cpp similarity index 90% rename from libcxx/test/libcxx/modules/cstdint_exports.sh.cpp rename to libcxx/test/libcxx/modules/cstdint_exports.compile.pass.cpp index 3ac9999..0887b59 100644 --- a/libcxx/test/libcxx/modules/cstdint_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/cstdint_exports.compile.pass.cpp @@ -14,17 +14,16 @@ // but still gets built as part of the 'std' module, which breaks the build. // XFAIL: libcpp-has-no-threads -// REQUIRES: modules-support - // Test that re-exports -// RUN: %{build_module} +// REQUIRES: modules-support +// ADDITIONAL_COMPILE_FLAGS: -fmodules #include int main(int, char**) { - int8_t x; ((void)x); - std::int8_t y; ((void)y); + int8_t x; (void)x; + std::int8_t y; (void)y; return 0; } diff --git a/libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp b/libcxx/test/libcxx/modules/inttypes_h_exports.compile.pass.cpp similarity index 93% rename from libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp rename to libcxx/test/libcxx/modules/inttypes_h_exports.compile.pass.cpp index 828635a..0add4e1 100644 --- a/libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/inttypes_h_exports.compile.pass.cpp @@ -14,16 +14,15 @@ // but still gets built as part of the 'std' module, which breaks the build. // XFAIL: libcpp-has-no-threads -// REQUIRES: modules-support - // Test that intypes.h re-exports stdint.h -// RUN: %{build_module} +// REQUIRES: modules-support +// ADDITIONAL_COMPILE_FLAGS: -fmodules #include int main(int, char**) { - int8_t x; ((void)x); + int8_t x; (void)x; return 0; } diff --git a/libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp b/libcxx/test/libcxx/modules/stdint_h_exports.compile.pass.cpp similarity index 82% rename from libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp rename to libcxx/test/libcxx/modules/stdint_h_exports.compile.pass.cpp index f38e5f4..b83e99b 100644 --- a/libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/stdint_h_exports.compile.pass.cpp @@ -10,16 +10,15 @@ // but still gets built as part of the 'std' module, which breaks the build. // XFAIL: libcpp-has-no-threads -// REQUIRES: modules-support - -// Test that int8_t and the like are exported from stdint.h not inttypes.h +// Test that int8_t and the like are exported from stdint.h, not inttypes.h -// RUN: %{build_module} +// REQUIRES: modules-support +// ADDITIONAL_COMPILE_FLAGS: -fmodules #include int main(int, char**) { - int8_t x; ((void)x); + int8_t x; (void)x; return 0; } diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index 78989cc..3c18a36 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -1009,10 +1009,6 @@ class Configuration(object): if self.cxx.isVerifySupported(): sub.append(('%{verify}', ' '.join(self.cxx.verify_flags))) sub.append(('%{build}', '%{cxx} -o %t.exe %s %{flags} %{compile_flags} %{link_flags}')) - if self.cxx.use_modules: - sub.append(('%{build_module}', '%{build}')) - elif self.cxx.modules_flags is not None: - sub.append(('%{build_module}', '%{{build}} {}'.format(' '.join(self.cxx.modules_flags)))) # Configure exec prefix substitutions. # Configure run env substitution.