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 {
78
78
TEST_CASE (testParameterPack); // #11289
79
79
80
80
TEST_CASE (testDefaultSignInt); // #13363
81
+ TEST_CASE (testPrintfWithGeneric); // #13592
81
82
}
82
83
83
84
struct CheckOptions
@@ -4952,6 +4953,16 @@ class TestIO : public TestFixture {
4952
4953
check (code, dinit (CheckOptions, $.defaultSign = ' u' ));
4953
4954
ASSERT_EQUALS (" " , errout_str ());
4954
4955
}
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
+ }
4955
4966
};
4956
4967
4957
4968
REGISTER_TEST (TestIO)
You can’t perform that action at this time.
0 commit comments