Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-linkedlist fails #13

Open
jrp2014 opened this issue May 8, 2021 · 0 comments · May be fixed by #14
Open

test-linkedlist fails #13

jrp2014 opened this issue May 8, 2021 · 0 comments · May be fixed by #14

Comments

@jrp2014
Copy link

jrp2014 commented May 8, 2021

I've set up your mcc compiler to work with llvm 12 (cabal.project file:

packages: ./llvm-hs-pretty
          ./llvm-hs/llvm-hs-pure
          ./llvm-hs/llvm-hs
          ./mcc

)

using the llvm-12 branches of llvm-hs-pretty and llvm-hs and relaxing the bounds in the mcc.cabal file. (Running on MacOS.)

All the cabal test tests pass, apart from test-linkedlist, which produces

cabal run mcc --  tests/pass/test-linkedlist.mc -c -o linkedlist
Up to date

mcc on  llvm-12 [!?] 
❯ ./linkedlist
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-1991765899
zsh: segmentation fault  ./linkedlist

Fortunately, just initializing l and l2 solves the problem.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────
modified: tests/pass/test-linkedlist.mc
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
@ tests/pass/test-linkedlist.mc:36 @ int main() {
  int i;
  struct List *l;
  struct List *l2;
 
  l = NULL;
  l2 = NULL;
 
  for (i = 0; i < 20; i = i + 1) {
    l = cons(i, l);
  }

Thanks for the great tutorial. I'll have a deeper look.

@jmorag jmorag linked a pull request May 10, 2021 that will close this issue
@jmorag jmorag linked a pull request May 10, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant