diff options
Diffstat (limited to '')
-rw-r--r-- | tests/test/cpp/preprocessor2.scm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test/cpp/preprocessor2.scm b/tests/test/cpp/preprocessor2.scm index e2ff0a17..9e11bb04 100644 --- a/tests/test/cpp/preprocessor2.scm +++ b/tests/test/cpp/preprocessor2.scm @@ -545,6 +545,26 @@ f(10) +(define cpp-file-stack (@@ (c cpp-environment) cpp-file-stack)) +(define handle-line-directive (@@ (c preprocessor2) handle-line-directive)) + +(test-group "Line directive" + (let ((e (make-environment))) + (test-equal "#line <number>" + '(("*outside*" . 10)) + (cpp-file-stack (handle-line-directive e (lex "10")))) + (test-equal "#line <line> <file>" + '(("file" . 10)) + (cpp-file-stack (handle-line-directive e (lex "10 \"file\"")))) + + (test-equal "#line <macro>" + '(("*outside*" . 10)) + (cpp-file-stack + (handle-line-directive + (resolve-define e (lex "x 10")) + (lex "x")))))) + + ;; resolve-h-file ;; resolve-q-file ;; handle-pragma |