Add some more test cases for fentry and pg
authorAndi Kleen <ak@linux.intel.com>
Tue, 16 Sep 2014 03:22:53 +0000 (03:22 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Tue, 16 Sep 2014 03:22:53 +0000 (03:22 +0000)
Test fentry and no_instrument_function overriding.

gcc/testsuite/:

2014-09-15  Andi Kleen  <ak@linux.intel.com>

* gcc.dg/pg-override.c: New test.
* gcc.dg/pg.c: New test.
* gcc.target/i386/fentry-override.c: New test.
* gcc.target/i386/fentry.c: New test.

From-SVN: r215285

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pg-override.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pg.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fentry-override.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fentry.c [new file with mode: 0644]

index 45e2384281f7ae7f719cc3a608cc4bfcbe666797..fdb706a8d8dd3b54f02f91060268f31aeac518e5 100644 (file)
@@ -1,3 +1,10 @@
+2014-09-15  Andi Kleen  <ak@linux.intel.com>
+
+       * gcc.dg/pg-override.c: New test.
+       * gcc.dg/pg.c: New test.
+       * gcc.target/i386/fentry-override.c: New test.
+       * gcc.target/i386/fentry.c: New test.
+
 2014-09-15  Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/56408
diff --git a/gcc/testsuite/gcc.dg/pg-override.c b/gcc/testsuite/gcc.dg/pg-override.c
new file mode 100644 (file)
index 0000000..1490c1d
--- /dev/null
@@ -0,0 +1,18 @@
+/* Test -fprofile override */
+/* { dg-do compile } */
+/* { dg-options "-fprofile" { target { { i686-*-* x86_64-*-* } } } } */
+/* { dg-final { scan-assembler-not "mcount" } } */
+/* Origin: Andi Kleen */
+extern void foobar(const char *);
+
+__attribute__((no_instrument_function)) void func(void)
+{
+  foobar ("Hello world\n");
+}
+
+__attribute__((no_instrument_function)) void func2(void)
+{
+  int i;
+  for (i = 0; i < 10; i++)
+    foobar ("Hello world");
+}
diff --git a/gcc/testsuite/gcc.dg/pg.c b/gcc/testsuite/gcc.dg/pg.c
new file mode 100644 (file)
index 0000000..1490c1d
--- /dev/null
@@ -0,0 +1,18 @@
+/* Test -fprofile override */
+/* { dg-do compile } */
+/* { dg-options "-fprofile" { target { { i686-*-* x86_64-*-* } } } } */
+/* { dg-final { scan-assembler-not "mcount" } } */
+/* Origin: Andi Kleen */
+extern void foobar(const char *);
+
+__attribute__((no_instrument_function)) void func(void)
+{
+  foobar ("Hello world\n");
+}
+
+__attribute__((no_instrument_function)) void func2(void)
+{
+  int i;
+  for (i = 0; i < 10; i++)
+    foobar ("Hello world");
+}
diff --git a/gcc/testsuite/gcc.target/i386/fentry-override.c b/gcc/testsuite/gcc.target/i386/fentry-override.c
new file mode 100644 (file)
index 0000000..3771f19
--- /dev/null
@@ -0,0 +1,18 @@
+/* Test -mfentry override */
+/* { dg-do compile } */
+/* { dg-options "-mfentry" } */
+/* { dg-final { scan-assembler-not "__fentry__" } } */
+/* Origin: Andi Kleen */
+extern void foobar(const char *);
+
+void __attribute__((no_instrument_function)) func(void)
+{
+  foobar ("Hello world\n");
+}
+
+void __attribute__((no_instrument_function)) func2(void)
+{
+  int i;
+  for (i = 0; i < 10; i++)
+    foobar ("Hello world");
+}
diff --git a/gcc/testsuite/gcc.target/i386/fentry.c b/gcc/testsuite/gcc.target/i386/fentry.c
new file mode 100644 (file)
index 0000000..bd3db13
--- /dev/null
@@ -0,0 +1,18 @@
+/* Test -mfentry */
+/* { dg-do compile } */
+/* { dg-options "-fprofile -mfentry" } */
+/* { dg-final { scan-assembler "__fentry__" } } */
+/* Origin: Andi Kleen */
+extern void foobar(const char *);
+
+void func(void)
+{
+  foobar ("Hello world\n");
+}
+
+void func2(void)
+{
+  int i;
+  for (i = 0; i < 10; i++)
+    foobar ("Hello world");
+}