gcc/testsuite/ChangeLog:

        * gcc.dg/lto/toplevel-asm_0.c: New test.
        * gcc.dg/lto/toplevel-asm_1.c: New test.
        * gcc.dg/lto/toplevel-asm_2.c: New test.
---
 gcc/testsuite/gcc.dg/lto/toplevel-asm_0.c | 8 ++++++++
 gcc/testsuite/gcc.dg/lto/toplevel-asm_1.c | 7 +++++++
 gcc/testsuite/gcc.dg/lto/toplevel-asm_2.c | 2 ++
 3 files changed, 17 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/lto/toplevel-asm_0.c
 create mode 100644 gcc/testsuite/gcc.dg/lto/toplevel-asm_1.c
 create mode 100644 gcc/testsuite/gcc.dg/lto/toplevel-asm_2.c

diff --git a/gcc/testsuite/gcc.dg/lto/toplevel-asm_0.c 
b/gcc/testsuite/gcc.dg/lto/toplevel-asm_0.c
new file mode 100644
index 00000000000..1621b51646c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/toplevel-asm_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O2 -flto -flto-partition=1to1} } { target x86_64-*-* } 
} */
+
+extern void inlined_function (int a);
+
+int main () {
+    inlined_function (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/toplevel-asm_1.c 
b/gcc/testsuite/gcc.dg/lto/toplevel-asm_1.c
new file mode 100644
index 00000000000..004e59bc365
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/toplevel-asm_1.c
@@ -0,0 +1,7 @@
+/* Test that static_function and the asm remains in same translation unit.  */
+__attribute__((used))
+static void static_function (int a) {}
+asm (".quad static_function");
+
+void inlined_function (int a) {}
+asm (".quad inlined_function");
diff --git a/gcc/testsuite/gcc.dg/lto/toplevel-asm_2.c 
b/gcc/testsuite/gcc.dg/lto/toplevel-asm_2.c
new file mode 100644
index 00000000000..23d51933b98
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/toplevel-asm_2.c
@@ -0,0 +1,2 @@
+__attribute__((used))
+void dummy () {}
-- 
2.50.0

Reply via email to