[GHC] #9399: CPP does not process test case enum01.hs correctly

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Keywords: cpp | Operating System: MacOS X Architecture: x86_64 (amd64) | Type of failure: GHC Difficulty: Unknown | rejects valid program Blocked By: | Test Case: enum01.hs Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- The printTest cpp macro does not seem to be being applied in the test suite test enum01.hs (libraries/base) {{{
ghci -cpp enum01.hs GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Main ( enum01.hs, interpreted )
enum01.hs:91:3: Not in scope: ‘printTest’ enum01.hs:92:3: Not in scope: ‘printTest’ : }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Works for me. A clang CPP issue perhaps? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jrp): Possibly. Not sure how to test whether it is. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Oh yes, I see `clang -E -traditional` doesn't expand the `printTest` macro because of the space after the macro name. We could fix the test to be clang-compatible of course, but I don't know whether that is the right thing to do. Perhaps the fact that ghci has invoked clang at all indicates that something has already gone wrong. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jrp): Don't follow you. The test explicitly invokes CPP (both on the command line and with a pragma). If you clang -P - < enum0x.hs the macro printTest seems to be expanded. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): But not with `-traditional`. Try `ghci -v -cpp enum01.hs`; how does `ghci` invoke the C pre-processor (should follow the line `*** C pre- processor:`)? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jrp): I think that the test should be fixed to make it Clang-compatible. That way it will test enum, which is what it is supposed to do. The same applies to enum02-04. We should then have another test specifically for cpp behaviour. (I would do this, but don't have commit access.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Replying to [comment:6 jrp]:
I think that the test should be fixed to make it Clang-compatible. That way it will test enum, which is what it is supposed to do. The same applies to enum02-04.
Agreed. Would you like to prepare a patch? I expect all that's needed is to remove all the spaces after occurrences of `printTest`. (Otherwise I will get around to it eventually.)
We should then have another test specifically for cpp behaviour. (I would do this, but don't have commit access.)
So I take it the test fails for you with WAY=ghci, but not any of the other ways? That's a bit perplexing and deserves a test, yes. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jrp): I think that that is right: {{{ ../../libraries/base/tests enum01 [exit code non-0] (normal,hpc,optasm,profasm,threaded1,threaded2,dyn,profthreaded,optllvm) ../../libraries/base/tests enum01 [bad stdout or stderr] (ghci) ../../libraries/base/tests enum02 [exit code non-0] (normal,hpc,optasm,profasm,threaded1,threaded2,dyn,profthreaded,optllvm) ../../libraries/base/tests enum02 [bad stdout or stderr] (ghci) ../../libraries/base/tests enum03 [exit code non-0] (normal,hpc,optasm,profasm,threaded1,threaded2,dyn,profthreaded,optllvm) ../../libraries/base/tests enum03 [bad stdout or stderr] (ghci) }}} (Could I leave it to you for the patches, as I don't have commit access.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: rwbarton Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: enum01.hs | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by rwbarton): * owner: => rwbarton Comment: Oh, so it is failing in all WAYs, good, that makes more sense. Sure, I will adjust the tests. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: rwbarton Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: enum01.hs Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D957 -------------------------------------+------------------------------------- Changes (by rwbarton): * differential: => Phab:D957 Comment: This turned out to be more complicated than expected because clang's traditional mode ''also'' doesn't support stringification in any way as far as I can tell, so I replaced the use of CPP by a custom preprocessor. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly
-------------------------------------+-------------------------------------
Reporter: jrp | Owner: rwbarton
Type: bug | Status: new
Priority: normal | Milestone:
Component: Test Suite | Version: 7.8.3
Resolution: | Keywords: cpp
Operating System: MacOS X | Architecture: x86_64
Type of failure: GHC rejects | (amd64)
valid program | Test Case: enum01.hs
Blocked By: | Blocking:
Related Tickets: | Differential Revisions: Phab:D957
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: rwbarton Type: bug | Status: merge Priority: normal | Milestone: Component: Test Suite | Version: 7.8.3 Resolution: | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: enum01.hs Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D957 -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => merge Comment: I added a description to the processor itself in a7eee0d8a25789ce1ef349304d27e2a5e22766b7. Merge if desired. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: rwbarton Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Test Suite | Version: 7.8.3 Resolution: fixed | Keywords: cpp Operating System: MacOS X | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: enum01.hs Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D957 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed * milestone: => 7.10.2 Comment: Merged to `ghc-7.10`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.11 Resolution: | Keywords: cpp Operating System: Windows | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: enum01.hs Blocked By: | Blocking: Related Tickets: #365 | Differential Revisions: Phab:D957 -------------------------------------+------------------------------------- Changes (by thomie): * status: closed => new * resolution: fixed => * related: => #365 * version: 7.8.3 => 7.11 * milestone: 7.10.2 => * owner: rwbarton => * os: MacOS X => Windows Comment: Now it's broken on Windows. GHC on Windows can't handle a shell script as an argument to `-pgmF`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9399: CPP does not process test case enum01.hs correctly
-------------------------------------+-------------------------------------
Reporter: jrp | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Test Suite | Version: 7.11
Resolution: | Keywords: cpp
Operating System: Windows | Architecture: x86_64
Type of failure: GHC rejects | (amd64)
valid program | Test Case: enum01.hs
Blocked By: | Blocking:
Related Tickets: #365 | Differential Revisions: Phab:D957
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema

#9399: CPP does not process test case enum01.hs correctly
-------------------------------------+-------------------------------------
Reporter: jrp | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Test Suite | Version: 7.11
Resolution: | Keywords: cpp
Operating System: Windows | Architecture: x86_64
Type of failure: GHC rejects | (amd64)
valid program | Test Case: enum01.hs
Blocked By: | Blocking:
Related Tickets: #365 | Differential Rev(s): Phab:D957
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#9399: CPP does not process test case enum01.hs correctly
-------------------------------------+-------------------------------------
Reporter: jrp | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Test Suite | Version: 7.11
Resolution: | Keywords: cpp
Operating System: Windows | Architecture: x86_64
Type of failure: GHC rejects | (amd64)
valid program | Test Case: enum01.hs
Blocked By: | Blocking:
Related Tickets: #365 | Differential Rev(s): Phab:D957
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema

#9399: CPP does not process test case enum01.hs correctly -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Test Suite | Version: 7.11 Resolution: fixed | Keywords: cpp Operating System: Windows | Architecture: x86_64 | (amd64) Type of failure: GHC rejects | Test Case: valid program | libraries/base/tests/enum01 Blocked By: | Blocking: Related Tickets: #365 | Differential Rev(s): Phab:D957 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * testcase: enum01.hs => libraries/base/tests/enum01 * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9399#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC