[pkg-d-commits] [ldc] 206/211: Properly mark lit tests that require X86. Should fix these tests on ARM.
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:36:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.1.0
in repository ldc.
commit b6938861ae6b2c0227b938b0e6fe21bc2143fef7
Author: Johan Engelen <jbc.engelen at gmail.com>
Date: Fri Jan 13 20:54:00 2017 +0100
Properly mark lit tests that require X86. Should fix these tests on ARM.
---
tests/codegen/asm_output.d | 7 +++---
tests/codegen/inlining_leakdefinitions.d | 14 -----------
tests/codegen/inlining_leakdefinitions_asm.d | 37 ++++++++++++++++++++++++++++
tests/codegen/inputs/inlinables.d | 9 -------
tests/codegen/inputs/inlinables_asm.d | 14 +++++++++++
tests/codegen/llvm_used_1.d | 2 ++
6 files changed, 56 insertions(+), 27 deletions(-)
diff --git a/tests/codegen/asm_output.d b/tests/codegen/asm_output.d
index 701446e..f3bc8d0 100644
--- a/tests/codegen/asm_output.d
+++ b/tests/codegen/asm_output.d
@@ -1,10 +1,9 @@
// RUN: %ldc -c -output-ll -of=%t.ll %s && FileCheck %s --check-prefix LLVM < %t.ll
// RUN: %ldc -c -output-s -of=%t.s %s && FileCheck %s --check-prefix ASM < %t.s
-int main() {
+int foo() {
return 42;
// Try to keep these very simple checks independent of architecture:
-// LLVM: ret i32 42
-// ASM: $42
-// ASM: ret
+// LLVM: ret i32 42
+// ASM: {{(\$|#)}}42
}
diff --git a/tests/codegen/inlining_leakdefinitions.d b/tests/codegen/inlining_leakdefinitions.d
index fb912eb..b6314e9 100644
--- a/tests/codegen/inlining_leakdefinitions.d
+++ b/tests/codegen/inlining_leakdefinitions.d
@@ -12,11 +12,6 @@ import inputs.inlinables;
extern (C): // simplify mangling for easier matching
-// Inlined naked asm func could end up as global symbols, definitely bad!
-// (would give multiple definition linker error)
-// OPT0-NOT: module asm {{.*}}.globl{{.*}}_naked_asm_func
-// OPT3-NOT: module asm {{.*}}.globl{{.*}}_naked_asm_func
-
// Check that the global variables that are added due to "available_externally
// inlining" do not have initializers, i.e. they are declared only and not definined.
@@ -47,15 +42,6 @@ void dont_leak_module_variables()
// OPT3: ret void
}
-// OPT0-LABEL: define{{.*}} @asm_func(
-// OPT3-LABEL: define{{.*}} @asm_func(
-void asm_func()
-{
- naked_asm_func();
- // OPT0: ret void
- // OPT3: ret void
-}
-
// OPT0-LABEL: define{{.*}} @main(
// OPT3-LABEL: define{{.*}} @main(
int main()
diff --git a/tests/codegen/inlining_leakdefinitions_asm.d b/tests/codegen/inlining_leakdefinitions_asm.d
new file mode 100644
index 0000000..e404c35
--- /dev/null
+++ b/tests/codegen/inlining_leakdefinitions_asm.d
@@ -0,0 +1,37 @@
+// Test that inlining does not leak definitions without marking them as available_externally
+// "Leaking" = symbols definitions in .o file that shouldn't be declarations instead (undefined symbols).
+
+// REQUIRES: target_X86
+// REQUIRES: atleast_llvm307
+
+// RUN: %ldc %s -mtriple=x86_64-linux-gnu -I%S -c -output-ll -release -O3 -enable-cross-module-inlining -of=%t.O3.ll && FileCheck %s --check-prefix OPT3 < %t.O3.ll
+// RUN: %ldc %s -mtriple=x86_64-linux-gnu -I%S -c -output-ll -release -enable-inlining -O0 -enable-cross-module-inlining -of=%t.O0.ll && FileCheck %s --check-prefix OPT0 < %t.O0.ll
+
+import inputs.inlinables_asm;
+
+extern (C): // simplify mangling for easier matching
+
+// Inlined naked asm func could end up as global symbols, definitely bad!
+// (would give multiple definition linker error)
+// OPT0-NOT: module asm {{.*}}.globl{{.*}}_naked_asm_func
+// OPT3-NOT: module asm {{.*}}.globl{{.*}}_naked_asm_func
+
+// OPT0-LABEL: define{{.*}} @asm_func(
+// OPT3-LABEL: define{{.*}} @asm_func(
+void asm_func()
+{
+ naked_asm_func();
+ // OPT0: ret void
+ // OPT3: ret void
+}
+
+// OPT0-LABEL: define{{.*}} @main(
+// OPT3-LABEL: define{{.*}} @main(
+int main()
+{
+ asm_func();
+
+ return 0;
+ // OPT0: ret i32 0
+ // OPT3: ret i32 0
+}
diff --git a/tests/codegen/inputs/inlinables.d b/tests/codegen/inputs/inlinables.d
index 99dcf75..24f9a95 100644
--- a/tests/codegen/inputs/inlinables.d
+++ b/tests/codegen/inputs/inlinables.d
@@ -93,15 +93,6 @@ pragma(inline, true) auto get_typeid_A()
return typeid(A);
}
-pragma(inline, true) extern (C) void naked_asm_func()
-{
- asm pure nothrow @nogc
- {
- naked;
- nop;
- }
-}
-
pragma(inline, true) int call_template_foo(int i)
{
return template_foo(i);
diff --git a/tests/codegen/inputs/inlinables_asm.d b/tests/codegen/inputs/inlinables_asm.d
new file mode 100644
index 0000000..dca9418
--- /dev/null
+++ b/tests/codegen/inputs/inlinables_asm.d
@@ -0,0 +1,14 @@
+module inputs.inlinables_asm;
+
+import ldc.attributes;
+
+extern (C): // simplify mangling for easier function name matching
+
+pragma(inline, true) extern (C) void naked_asm_func()
+{
+ asm pure nothrow @nogc
+ {
+ naked;
+ nop;
+ }
+}
diff --git a/tests/codegen/llvm_used_1.d b/tests/codegen/llvm_used_1.d
index a23045a..e364c80 100644
--- a/tests/codegen/llvm_used_1.d
+++ b/tests/codegen/llvm_used_1.d
@@ -1,5 +1,7 @@
// Test that llvm.used is emitted correctly when multiple D modules are compiled into one LLVM module.
+// REQUIRES: target_X86
+
// Explicitly use a Linux triple, so that llvm.used is used for moduleinfo globals.
// RUN: %ldc -c -output-ll -O3 %S/inputs/module_ctor.d %s -of=%t.ll -mtriple=x86_64-pc-linux-gnu && FileCheck --check-prefix=LLVM %s < %t.ll
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git
More information about the pkg-d-commits
mailing list