Re: [PATCH] D19835: Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
EricWF accepted this revision. EricWF added a reviewer: EricWF. EricWF added a comment. This revision is now accepted and ready to land. Accepting to get the test suite passing on newer linux distributions again. I tried modifying the tests to test the GLIBC version but IMO it was more complexity than it was worth. http://reviews.llvm.org/D19835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19835: Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
EricWF added a comment. In http://reviews.llvm.org/D19835#419547, @mclow.lists wrote: > How about not using XFAIL? > Instead, just test for those two conditions. > > Psuedo-code: > > #if defined(GLIBC) > #if GLIBC < 226 > #error > #elif TEST_STD_VER >= 11 > #error > #endif. Because I want this test to pass, not fail. I definitely don't want to force failure of a passing test. (Also it's not really that easy to test the GLIBC version.) http://reviews.llvm.org/D19835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19835: Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
mclow.lists added a comment. How about not using XFAIL? Instead, just test for those two conditions. Psuedo-code: #if defined(GLIBC) #if GLIBC < 226 #error #elif TEST_STD_VER >= 11 #error #endif. http://reviews.llvm.org/D19835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19835: Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
jroelofs added a comment. > Alternatively `static_assert(std::is_same bool>::value);` :-P > > Testing the return type isn't the problem. The problem is telling LIT *when* > we expect the test to fail using the `XFAIL` directive. O. I see. http://reviews.llvm.org/D19835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19835: Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
EricWF added a comment. In http://reviews.llvm.org/D19835#419211, @jroelofs wrote: > I think you could lean on the linker to cause the test to fail when the type > is wrong: > > bool isinf(double); > > typedef int (*expected_signature)(double); > > void assert_via_linker(decltype(isinf) blah); > void assert_via_linker(expected_signature blah) {} > > void foo() { > assert_via_linker(isinf); > } > > Alternatively `static_assert(std::is_same::value);` :-P Testing the return type isn't the problem. The problem is telling LIT *when* we expect the test to fail using the `XFAIL` directive. The test will pass for: - non-linux systems - GLIBC >= 2.26 and C++ >= 11. The test will fail for: - GLIBC < 2.26 - GLIBC >= 2.26 and C++ < 11. Trying to encode that within 'XFAIL' is currently not possible and http://reviews.llvm.org/D19835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19835: Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
jroelofs added a subscriber: jroelofs. jroelofs added a comment. I think you could lean on the linker to cause the test to fail when the type is wrong: bool isinf(double); typedef int (*expected_signature)(double); void assert_via_linker(decltype(isinf) blah); void assert_via_linker(expected_signature blah) {} void foo() { assert_via_linker(isinf); } http://reviews.llvm.org/D19835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits