From c977e142f70818d060ee797f9a916b25a53d8a1c Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Sat, 22 Apr 2023 21:06:00 -0400 Subject: [PATCH] disasm-test: Avoid llvm-as from crashing on mixed opaque/non-opaque pointers This bumps the `llvm-pretty` submodule to bring in the `fixupOpaquePtrs` function from elliottt/llvm-pretty#110 and use it in the `disasm-test` test suite. This is needed because we must give pretty-printed `llvm-pretty` ASTs to `llvm-as`, which strictly forbids mixing opaque and non-opaque pointers. See #177. --- disasm-test/Main.hs | 6 ++++-- llvm-pretty | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/disasm-test/Main.hs b/disasm-test/Main.hs index 194940a0..2cea4d21 100644 --- a/disasm-test/Main.hs +++ b/disasm-test/Main.hs @@ -209,6 +209,7 @@ cube = TS.mkCUBE , "at-least-llvm12" , "at-least-llvm13" , "at-least-llvm14" + , "at-least-llvm15" ]) ] -- Somewhat unusually for tasty-sugar, we make the expectedSuffix the same @@ -369,11 +370,12 @@ processBitCode _keep (Roundtrip roundtrip) pfx file = do case e of Left err -> X.throwIO (ParseError err) Right m -> do - parsed <- printToTempFile "ll" (show (ppLLVM (ppModule m))) + let m' = AST.fixupOpaquePtrs m + parsed <- printToTempFile "ll" (show (ppLLVM (ppModule m'))) -- stripComments _keep parsed if roundtrip then do - tmp2 <- printToTempFile "ast" (ppShow (normalizeModule m)) + tmp2 <- printToTempFile "ast" (ppShow (normalizeModule m')) return (parsed, Just tmp2) else return (parsed, Nothing) diff --git a/llvm-pretty b/llvm-pretty index 16afdc1e..3fdba061 160000 --- a/llvm-pretty +++ b/llvm-pretty @@ -1 +1 @@ -Subproject commit 16afdc1ef2bc935ff615aa09d0c118ce4df6dd53 +Subproject commit 3fdba061c599762e440fa166d1de686b03c135cd