@@ -111,8 +111,9 @@ class function_test : public ::selftest::test
TEST_F (function_test, fndecl_int_void)
{
auto_vec <tree> param_types;
+ const char *name = "test_fndecl_int_void";
tree fndecl = make_fndecl (integer_type_node,
- "test_fndecl_int_void",
+ name,
param_types);
ASSERT_TRUE (fndecl != NULL);
@@ -122,7 +123,7 @@ TEST_F (function_test, fndecl_int_void)
EXPECT_EQ (IDENTIFIER_NODE, TREE_CODE (declname));
/* We expect it to use a *copy* of the string we passed in. */
const char *identifier_ptr = IDENTIFIER_POINTER (declname);
- EXPECT_NE ("test_fndecl_int_void", identifier_ptr);
+ EXPECT_NE (name, identifier_ptr);
EXPECT_EQ (0, strcmp ("test_fndecl_int_void", identifier_ptr));
/* Verify type of fndecl. */
@@ -145,8 +146,9 @@ TEST_F (function_test, fndecl_float_intchar)
auto_vec <tree> param_types;
param_types.safe_push (integer_type_node);
param_types.safe_push (char_type_node);
+ const char *name = "test_fndecl_float_intchar";
tree fndecl = make_fndecl (float_type_node,
- "test_fndecl_float_intchar",
+ name,
param_types);
ASSERT_TRUE (fndecl != NULL);
@@ -156,8 +158,8 @@ TEST_F (function_test, fndecl_float_intchar)
EXPECT_EQ (IDENTIFIER_NODE, TREE_CODE (declname));
/* We expect it to use a *copy* of the string we passed in. */
const char *identifier_ptr = IDENTIFIER_POINTER (declname);
- EXPECT_NE ("test_fndecl_float_intchar", identifier_ptr);
- EXPECT_EQ (0, strcmp ("test_fndecl_float_intchar", identifier_ptr));
+ EXPECT_NE (name, identifier_ptr);
+ EXPECT_EQ (0, strcmp (name, identifier_ptr));
/* Verify type of fndecl. */
EXPECT_EQ (FUNCTION_DECL, TREE_CODE (fndecl));