Negative test for AddressingModel, MemoryModel.
authorDejan Mircevski <deki@google.com>
Fri, 9 Oct 2015 18:21:03 +0000 (14:21 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
test/TextToBinary.ModeSetting.cpp

index 6f26b3e..955ab31 100644 (file)
@@ -86,6 +86,13 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
 #undef CASE
 // clang-format on
 
+TEST_F(OpMemoryModelTest, WrongModel) {
+  EXPECT_THAT(CompileFailure("OpMemoryModel xxyyzz Simple"),
+              Eq("Invalid addressing model 'xxyyzz'."));
+  EXPECT_THAT(CompileFailure("OpMemoryModel Logical xxyyzz"),
+              Eq("Invalid memory model 'xxyyzz'."));
+}
+
 // Test OpEntryPoint
 
 // An example case for OpEntryPoint