aboutsummaryrefslogtreecommitdiff
path: root/hypsrc-test
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2019-02-11 12:27:41 -0500
committerGitHub <noreply@github.com>2019-02-11 12:27:41 -0500
commit9790200cb854b75e00afaf2eea49a22b7223b200 (patch)
tree0652623398095f3eaaeb30845c877785a342452a /hypsrc-test
parent4e8321de13225f1f5bdec8f39993e9b1aa0831a8 (diff)
Remove workaround for now-fixed Clang CPP bug (#1028)
Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code).
Diffstat (limited to 'hypsrc-test')
-rw-r--r--hypsrc-test/Main.hs9
-rw-r--r--hypsrc-test/ref/src/ClangCppBug.html306
-rw-r--r--hypsrc-test/src/ClangCppBug.hs21
3 files changed, 1 insertions, 335 deletions
diff --git a/hypsrc-test/Main.hs b/hypsrc-test/Main.hs
index 1963753d..f7614927 100644
--- a/hypsrc-test/Main.hs
+++ b/hypsrc-test/Main.hs
@@ -20,18 +20,11 @@ checkConfig = CheckConfig
, ccfgEqual = (==) `on` dumpXml
}
where
- -- The whole point of the ClangCppBug is to demonstrate a situation where
- -- line numbers may vary (and test that links still work). Consequently, we
- -- strip out line numbers for this test case.
- strip f | takeBaseName f == "ClangCppBug"
- = stripAnchors' . stripLinks' . stripIds' . stripIds'' . stripFooter
- | otherwise
- = stripAnchors' . stripLinks' . stripIds' . stripFooter
+ strip _ = stripAnchors' . stripLinks' . stripIds' . stripFooter
stripLinks' = stripLinksWhen $ \href -> "#local-" `isPrefixOf` href
stripAnchors' = stripAnchorsWhen $ \name -> "local-" `isPrefixOf` name
stripIds' = stripIdsWhen $ \name -> "local-" `isPrefixOf` name
- stripIds'' = stripIdsWhen $ \name -> "line-" `isPrefixOf` name
dirConfig :: DirConfig
diff --git a/hypsrc-test/ref/src/ClangCppBug.html b/hypsrc-test/ref/src/ClangCppBug.html
deleted file mode 100644
index b76b53a7..00000000
--- a/hypsrc-test/ref/src/ClangCppBug.html
+++ /dev/null
@@ -1,306 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml"
-><head
- ><link rel="stylesheet" type="text/css" href="style.css"
- /><script type="text/javascript" src="highlight.js"
- ></script
- ></head
- ><body
- ><pre
- ><span class="hs-pragma"
- >{-# LANGUAGE CPP #-}</span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="hs-keyword"
- >module</span
- ><span
- > </span
- ><span class="hs-identifier"
- >ClangCppBug</span
- ><span
- > </span
- ><span class="hs-keyword"
- >where</span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="annot"
- ><a href="ClangCppBug.html#foo"
- ><span class="hs-identifier hs-type"
- >foo</span
- ></a
- ></span
- ><span
- > </span
- ><span class="hs-glyph"
- >::</span
- ><span
- > </span
- ><span class="annot"
- ><span class="hs-identifier hs-type"
- >Int</span
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span id="foo"
- ><span class="annot"
- ><span class="annottext"
- >foo :: Int
-</span
- ><a href="ClangCppBug.html#foo"
- ><span class="hs-identifier hs-var hs-var"
- >foo</span
- ></a
- ></span
- ></span
- ><span
- > </span
- ><span class="hs-glyph"
- >=</span
- ><span
- > </span
- ><span class="annot"
- ><span class="hs-number"
- >1</span
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="hs-comment"
- >-- Clang doesn't mind these:</span
- ><span class="hs-cpp"
- >
-#define BAX 2
-</span
- ><span class="hs-pragma"
- >{-# INLINE</span
- ><span
- > </span
- ><span class="annot"
- ><a href="ClangCppBug.html#bar"
- ><span class="hs-pragma hs-type"
- >bar</span
- ></a
- ></span
- ><span
- > </span
- ><span class="hs-pragma"
- >#-}</span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="annot"
- ><a href="ClangCppBug.html#bar"
- ><span class="hs-identifier hs-type"
- >bar</span
- ></a
- ></span
- ><span
- > </span
- ><span class="hs-glyph"
- >::</span
- ><span
- > </span
- ><span class="annot"
- ><span class="hs-identifier hs-type"
- >Int</span
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span id="bar"
- ><span class="annot"
- ><span class="annottext"
- >bar :: Int
-</span
- ><a href="ClangCppBug.html#bar"
- ><span class="hs-identifier hs-var hs-var"
- >bar</span
- ></a
- ></span
- ></span
- ><span
- > </span
- ><span class="hs-glyph"
- >=</span
- ><span
- > </span
- ><span class="annot"
- ><span class="hs-number"
- >3</span
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="hs-comment"
- >-- But it doesn't like this:</span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="hs-pragma"
- >{-# RULES</span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="annot"
- ><span class="hs-pragma"
- >&quot;bar/qux&quot;</span
- ></span
- ><span
- > </span
- ><span class="annot"
- ><a href="ClangCppBug.html#bar"
- ><span class="hs-pragma hs-type"
- >bar</span
- ></a
- ></span
- ><span
- > </span
- ><span class="hs-pragma"
- >=</span
- ><span
- > </span
- ><span class="annot"
- ><a href="ClangCppBug.html#qux"
- ><span class="hs-pragma hs-type"
- >qux</span
- ></a
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="annot"
- ><span class="hs-pragma"
- >&quot;qux/foo&quot;</span
- ></span
- ><span
- > </span
- ><span class="annot"
- ><a href="ClangCppBug.html#qux"
- ><span class="hs-pragma hs-type"
- >qux</span
- ></a
- ></span
- ><span
- > </span
- ><span class="hs-pragma"
- >=</span
- ><span
- > </span
- ><span class="annot"
- ><a href="ClangCppBug.html#foo"
- ><span class="hs-pragma hs-type"
- >foo</span
- ></a
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span
- > </span
- ><span class="hs-pragma"
- >#-}</span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span class="annot"
- ><a href="ClangCppBug.html#qux"
- ><span class="hs-identifier hs-type"
- >qux</span
- ></a
- ></span
- ><span
- > </span
- ><span class="hs-glyph"
- >::</span
- ><span
- > </span
- ><span class="annot"
- ><span class="hs-identifier hs-type"
- >Int</span
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ><span id="qux"
- ><span class="annot"
- ><span class="annottext"
- >qux :: Int
-</span
- ><a href="ClangCppBug.html#qux"
- ><span class="hs-identifier hs-var hs-var"
- >qux</span
- ></a
- ></span
- ></span
- ><span
- > </span
- ><span class="hs-glyph"
- >=</span
- ><span
- > </span
- ><span class="annot"
- ><span class="hs-number"
- >88</span
- ></span
- ><span
- >
-</span
- ><span id=""
- ></span
- ></pre
- ></body
- ></html
->
diff --git a/hypsrc-test/src/ClangCppBug.hs b/hypsrc-test/src/ClangCppBug.hs
deleted file mode 100644
index 4b0bc35f..00000000
--- a/hypsrc-test/src/ClangCppBug.hs
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# LANGUAGE CPP #-}
-module ClangCppBug where
-
-foo :: Int
-foo = 1
-
--- Clang doesn't mind these:
-#define BAX 2
-{-# INLINE bar #-}
-
-bar :: Int
-bar = 3
-
--- But it doesn't like this:
-{-# RULES
-"bar/qux" bar = qux
-"qux/foo" qux = foo
- #-}
-
-qux :: Int
-qux = 88