Commit 926f1caa by Yi Xu Committed by Commit Bot

Add support for GCC Compilers

Add support for GCC Compilers, so it can be build on Ubuntu. BUG=angleproject:3392 Change-Id: I2f5ac7355a40f52123bd465f86b1e966c59c943d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1592062Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Yi Xu <yiyix@chromium.org>
parent 69f72b41
......@@ -248,7 +248,7 @@ std::ostream &FmtHex(std::ostream &os, T value)
# define EVENT(message, ...) (void(0))
#endif
#if defined(COMPILER_GCC) || defined(__clang__)
#if defined(__GNUC__)
# define ANGLE_CRASH() __builtin_trap()
#else
# define ANGLE_CRASH() ((void)(*(volatile char *)0 = 0)), __assume(0)
......@@ -336,7 +336,7 @@ std::ostream &FmtHex(std::ostream &os, T value)
# define ANGLE_ENABLE_STRUCT_PADDING_WARNINGS \
_Pragma("clang diagnostic push") _Pragma("clang diagnostic error \"-Wpadded\"")
# define ANGLE_DISABLE_STRUCT_PADDING_WARNINGS _Pragma("clang diagnostic pop")
#elif defined(COMPILER_GCC)
#elif defined(__GNUC__)
# define ANGLE_ENABLE_STRUCT_PADDING_WARNINGS \
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic error \"-Wpadded\"")
# define ANGLE_DISABLE_STRUCT_PADDING_WARNINGS _Pragma("GCC diagnostic pop")
......
......@@ -209,7 +209,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugId)
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1)
{
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
}
// Default behavior is to let missing tests pass
EXPECT_EQ(
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
......@@ -227,7 +229,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingBugIdWithCon
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1)
{
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
}
// Default behavior is to let missing tests pass
EXPECT_EQ(
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
......@@ -243,7 +247,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingColon)
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1)
{
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
}
// Default behavior is to let missing tests pass
EXPECT_EQ(
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
......@@ -278,7 +284,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingEquals)
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1)
{
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
}
// Default behavior is to let missing tests pass
EXPECT_EQ(
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
......@@ -294,7 +302,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMissingExpectation)
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1)
{
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
}
// Default behavior is to let missing tests pass
EXPECT_EQ(
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
......@@ -311,7 +321,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserInvalidExpectation)
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1)
{
EXPECT_EQ(parser.getErrorMessages()[0], "Line 1 : entry with wrong format");
}
// Default behavior is to let missing tests pass
EXPECT_EQ(
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
......@@ -330,8 +342,10 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserUnimplementedCondit
EXPECT_FALSE(parser.loadTestExpectations(config, line));
EXPECT_EQ(parser.getErrorMessages().size(), 1u);
if (parser.getErrorMessages().size() >= 1)
{
EXPECT_EQ(parser.getErrorMessages()[0],
"Line 1 : entry invalid, likely unimplemented modifiers");
}
// Default behavior is to let missing tests pass
EXPECT_EQ(
parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max"),
......@@ -368,7 +382,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserMisspelledExpectati
GPUTestExpectationsParser::kGpuTestPass);
EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u);
if (parser.getUnusedExpectationsMessages().size() >= 1)
{
EXPECT_EQ(parser.getUnusedExpectationsMessages()[0], "Line 1: expectation was unused.");
}
}
// Wild characters that match groups of expectations can be overridden with more specific lines.
......@@ -389,7 +405,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation
// The FAIL expectation was unused because it was overridden.
EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u);
if (parser.getUnusedExpectationsMessages().size() >= 1)
{
EXPECT_EQ(parser.getUnusedExpectationsMessages()[0], "Line 1: expectation was unused.");
}
// Now try a test that doesn't match the override criteria
EXPECT_EQ(parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.image.test"),
GPUTestExpectationsParser::kGpuTestFail);
......@@ -414,7 +432,9 @@ TEST(GPUTestExpectationsParserTest, GPUTestExpectationsParserOverrideExpectation
// The FAIL expectation was unused because it was overridden.
EXPECT_EQ(parser.getUnusedExpectationsMessages().size(), 1u);
if (parser.getUnusedExpectationsMessages().size() >= 1)
{
EXPECT_EQ(parser.getUnusedExpectationsMessages()[0], "Line 2: expectation was unused.");
}
// Now try a test that doesn't match the override criteria
EXPECT_EQ(parser.getTestExpectation("dEQP-GLES31.functional.layout_binding.image.test"),
GPUTestExpectationsParser::kGpuTestFail);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment