Skip to content

Commit 08484ca

Browse files
committed
add test
1 parent beb3362 commit 08484ca

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/testother.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ class TestOther : public TestFixture {
306306

307307
TEST_CASE(knownConditionFloating);
308308
TEST_CASE(knownConditionPrefixed);
309+
310+
TEST_CASE(ternarySameValuePlatformDependent); // #13773
309311
}
310312

311313
#define check(...) check_(__FILE__, __LINE__, __VA_ARGS__)
@@ -13093,6 +13095,19 @@ class TestOther : public TestFixture {
1309313095
"[test.cpp:2:13] -> [test.cpp:3:11]: (style) The comparison 'i > +1' is always false. [knownConditionTrueFalse]\n",
1309413096
errout_str());
1309513097
}
13098+
13099+
void ternarySameValuePlatformDependent() // #13773
13100+
{
13101+
check("typedef float _Complex complex_f32;\n"
13102+
"typedef struct {\n"
13103+
" uint16_t real;\n"
13104+
" uint16_t imag;\n"
13105+
"} packed_complex;\n"
13106+
"void foo(void) {\n"
13107+
" b = a ? sizeof(packed_complex) : sizeof(complex_f32);\n"
13108+
"}\n");
13109+
ASSERT_EQUALS("", errout_str());
13110+
}
1309613111
};
1309713112

1309813113
REGISTER_TEST(TestOther)

0 commit comments

Comments
 (0)