Skip to content

Commit

Permalink
Adapt lit-tests to LLVM 9
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Sep 21, 2019
1 parent 15b193f commit 1caf0b3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/codegen/array_equals_memcmp.d
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ bool four_bools(bool[4] a, bool[4] b)
// LLVM: call i32 @memcmp({{.*}}, {{.*}}, i{{32|64}} 4)

// Make sure that LLVM recognizes and optimizes-out the call to memcmp for 4 byte arrays:
// ASM-NOT: memcmp
// ASM-NOT: {{(mem|b)cmp}}
return a == b;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/codegen/array_equals_memcmp_dyn.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bool static_dynamic(bool[4] a, bool[] b)
// LLVM: call i32 @memcmp(

// Also test that LLVM recognizes and optimizes-out the call to memcmp for 4 byte arrays:
// ASM-NOT: memcmp
// ASM-NOT: {{(mem|b)cmp}}
return a == b;
}

Expand All @@ -24,7 +24,7 @@ bool inv_dynamic_dynamic(bool[] a, bool[] b)
{
// The front-end turns this into a call to druntime template function `object.__equals!(bool, bool).__equals(bool[], bool[])`
// After optimization (inlining), it should boil down to a length check and a call to memcmp.
// ASM: memcmp
// ASM: {{(mem|b)cmp}}
return a != b;
}

Expand Down
1 change: 0 additions & 1 deletion tests/linking/ir2obj_caching_flags1.d
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
// RUN: %ldc %s -c -of=%t%obj -cache=%t-dir -disable-simplify-libcalls -vv | FileCheck --check-prefix=NO_HIT %s
// RUN: %ldc %s -c -of=%t%obj -cache=%t-dir -disable-gc2stack -vv | FileCheck --check-prefix=NO_HIT %s
// RUN: %ldc %s -c -of=%t%obj -cache=%t-dir -enable-inlining -vv | FileCheck --check-prefix=NO_HIT %s
// RUN: %ldc %s -c -of=%t%obj -cache=%t-dir -unit-at-a-time=false -vv | FileCheck --check-prefix=NO_HIT %s
// RUN: %ldc %s -c -of=%t%obj -cache=%t-dir -strip-debug -vv | FileCheck --check-prefix=NO_HIT %s
// RUN: %ldc %s -c -of=%t%obj -cache=%t-dir -disable-loop-unrolling -vv | FileCheck --check-prefix=NO_HIT %s
// RUN: %ldc %s -c -of=%t%obj -cache=%t-dir -disable-loop-vectorization -vv | FileCheck --check-prefix=NO_HIT %s
Expand Down
1 change: 1 addition & 0 deletions tests/plugins/addFuncEntryCall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ LLVM_CONFIG ?= llvm-config

CXXFLAGS ?= -O3
CXXFLAGS += $(shell $(LLVM_CONFIG) --cxxflags) -fno-rtti -fpic
CXXFLAGS += -DLLVM_VERSION=$(LLVM_VERSION)
# Remove all warning flags (they may or may not be supported by the compiler)
CXXFLAGS := $(filter-out -W%,$(CXXFLAGS))
CXXFLAGS := $(filter-out -fcolor-diagnostics,$(CXXFLAGS))
Expand Down
6 changes: 5 additions & 1 deletion tests/plugins/addFuncEntryCall/addFuncEntryCallPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ bool FuncEntryCallPass::doInitialization(Module &M) {
// Add fwd declaration of the `void __test_funcentrycall(void)` function.
auto functionType = FunctionType::get(Type::getVoidTy(M.getContext()), false);
funcToCallUponEntry =
M.getOrInsertFunction("__test_funcentrycall", functionType);
M.getOrInsertFunction("__test_funcentrycall", functionType)
#if LLVM_VERSION >= 900
.getCallee()
#endif
;
return true;
}

Expand Down
1 change: 1 addition & 0 deletions tests/plugins/lit.local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ import re
if (config.plugins_supported):
config.available_features.add('Plugins')
config.environment['LLVM_CONFIG'] = os.path.join(config.llvm_tools_dir, 'llvm-config')
config.environment['LLVM_VERSION'] = str(config.llvm_version)

0 comments on commit 1caf0b3

Please sign in to comment.