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

Add more GCC flags to CI builds #656

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}

- name: Run tests
run: EFFEKT_VALGRIND=1 sbt clean test
run: EFFEKT_VALGRIND=1 EFFEKT_DEBUG=1 sbt clean test

- name: Assemble fully optimized js file
run: sbt effektJS/fullOptJS
Expand Down
3 changes: 2 additions & 1 deletion effekt/jvm/src/main/scala/effekt/Runner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,9 @@ object LLVMRunner extends Runner[String] {
val executableFile = basePath
var gccArgs = Seq(gcc, gccMainFile, "-o", executableFile, objPath) ++ linkedLibraries

if (C.config.debug()) gccArgs ++= Seq("-fsanitize=address,undefined", "-fstack-protector-all", "-Og", "-g", "-Wall", "-Wextra")
if (C.config.debug()) gccArgs ++= Seq("-g", "-Wall", "-Wextra", "-Werror")
if (C.config.valgrind()) gccArgs ++= Seq("-O0", "-g")
else if (C.config.debug()) gccArgs ++= Seq("-fsanitize=address,undefined", "-fstack-protector-all")

exec(gccArgs: _*)

Expand Down
4 changes: 4 additions & 0 deletions effekt/jvm/src/test/scala/effekt/EffektTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ trait EffektTests extends munit.FunSuite {
// Whether to execute using valgrind
def valgrind = false

// Whether to execute using debug mode
def debug = false

def output: File = new File(".") / "out" / "tests" / getClass.getName.toLowerCase

// The sources of all testfiles are stored here:
Expand Down Expand Up @@ -64,6 +67,7 @@ trait EffektTests extends munit.FunSuite {
"--out", output.getPath,
)
if (valgrind) options = options :+ "--valgrind"
if (debug) options = options :+ "--debug"
val configs = compiler.createConfig(options)
configs.verify()

Expand Down
1 change: 1 addition & 0 deletions effekt/jvm/src/test/scala/effekt/LLVMTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class LLVMTests extends EffektTests {
def backendName = "llvm"

override def valgrind = sys.env.get("EFFEKT_VALGRIND").nonEmpty
override def debug = sys.env.get("EFFEKT_DEBUG").nonEmpty

override lazy val positives: List[File] = List(
examplesDir / "llvm",
Expand Down
1 change: 1 addition & 0 deletions effekt/jvm/src/test/scala/effekt/StdlibTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class StdlibLLVMTests extends StdlibTests {
def backendName: String = "llvm"

override def valgrind = sys.env.get("EFFEKT_VALGRIND").nonEmpty
override def debug = sys.env.get("EFFEKT_DEBUG").nonEmpty

override def ignored: List[File] = List(
// Toplevel let-bindings (for ANSI-color-codes in output) not supported
Expand Down