File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ class TestIO : public TestFixture {
7878 TEST_CASE (testParameterPack); // #11289
7979
8080 TEST_CASE (testDefaultSignInt); // #13363
81+ TEST_CASE (testPrintfWithGeneric); // #13592
8182 }
8283
8384 struct CheckOptions
@@ -4952,6 +4953,16 @@ class TestIO : public TestFixture {
49524953 check (code, dinit (CheckOptions, $.defaultSign = ' u' ));
49534954 ASSERT_EQUALS (" " , errout_str ());
49544955 }
4956+
4957+ void testPrintfWithGeneric () { // #13592
4958+ const char code[] =
4959+ " void f(void) {\n "
4960+ " float x = 27.0f;\n "
4961+ " printf(\" %s\\ n\" , _Generic(x, double: cbrt, float: cbrtf)(x));\n "
4962+ " }\n " ;
4963+ check (code);
4964+ ASSERT_EQUALS (" " , errout_str ());
4965+ }
49554966};
49564967
49574968REGISTER_TEST (TestIO)
You can’t perform that action at this time.
0 commit comments