summaryrefslogtreecommitdiff
path: root/tests/preprocessor_tests/location_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/preprocessor_tests/location_test.cpp')
-rw-r--r--tests/preprocessor_tests/location_test.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/preprocessor_tests/location_test.cpp b/tests/preprocessor_tests/location_test.cpp
index 9532f71f..29897e36 100644
--- a/tests/preprocessor_tests/location_test.cpp
+++ b/tests/preprocessor_tests/location_test.cpp
@@ -200,7 +200,7 @@ TEST_F(LocationTest, LineDirectiveCommentsIgnored)
expectLocation(1, &str, NULL, loc);
}
-TEST_F(LocationTest, LineDirectiveWithMacro)
+TEST_F(LocationTest, LineDirectiveWithMacro1)
{
const char* str = "#define L 10\n"
"#define F(x) x\n"
@@ -208,6 +208,27 @@ TEST_F(LocationTest, LineDirectiveWithMacro)
"foo";
pp::SourceLocation loc(20, 10);
+ SCOPED_TRACE("LineDirectiveWithMacro1");
+ expectLocation(1, &str, NULL, loc);
+}
+
+TEST_F(LocationTest, LineDirectiveWithMacro2)
+{
+ const char* str = "#define LOC 10 20\n"
+ "#line LOC\n"
+ "foo";
+ pp::SourceLocation loc(20, 10);
+
+ SCOPED_TRACE("LineDirectiveWithMacro2");
+ expectLocation(1, &str, NULL, loc);
+}
+
+TEST_F(LocationTest, LineDirectiveWithPredefinedMacro)
+{
+ const char* str = "#line __LINE__ __FILE__\n"
+ "foo";
+ pp::SourceLocation loc(0, 1);
+
SCOPED_TRACE("LineDirectiveWithMacro");
expectLocation(1, &str, NULL, loc);
}