about summary refs log tree commit diff homepage
path: root/test/Concrete
diff options
context:
space:
mode:
Diffstat (limited to 'test/Concrete')
-rw-r--r--test/Concrete/CMakeLists.txt5
-rw-r--r--test/Concrete/Makefile.cmake.test.in2
2 files changed, 6 insertions, 1 deletions
diff --git a/test/Concrete/CMakeLists.txt b/test/Concrete/CMakeLists.txt
index b3e4948f..7fad17b9 100644
--- a/test/Concrete/CMakeLists.txt
+++ b/test/Concrete/CMakeLists.txt
@@ -6,4 +6,9 @@
 # License. See LICENSE.TXT for details.
 #
 #===------------------------------------------------------------------------===#
+if (${LLVM_VERSION_MAJOR} GREATER 4)
+  set(OZERO_OPT "-Xclang -disable-O0-optnone")
+else()
+  set(OZERO_OPT "-O0")
+endif()
 configure_file(Makefile.cmake.test.in Makefile.cmake.test @ONLY)
diff --git a/test/Concrete/Makefile.cmake.test.in b/test/Concrete/Makefile.cmake.test.in
index feb879de..2282bb08 100644
--- a/test/Concrete/Makefile.cmake.test.in
+++ b/test/Concrete/Makefile.cmake.test.in
@@ -13,7 +13,7 @@
 LLVMCC := @LLVMCC@
 LLVMAS := @LLVM_AS@
 LLVMLINK := @LLVM_LINK@
-LLVMCC.CFlags := -O0 -Wall
+LLVMCC.CFlags := @OZERO_OPT@ -Wall
 
 # Make sure source files can match the pattern rules
 VPATH := @CMAKE_CURRENT_SOURCE_DIR@