From: Andi Kleen Date: Tue, 16 Sep 2014 03:22:53 +0000 (+0000) Subject: Add some more test cases for fentry and pg X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a86507b29ec2520c70b12c84f4e6c1098f1a3fc0;p=gcc.git Add some more test cases for fentry and pg Test fentry and no_instrument_function overriding. gcc/testsuite/: 2014-09-15 Andi Kleen * 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 45e2384281f..fdb706a8d8d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2014-09-15 Andi Kleen + + * 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 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 index 00000000000..1490c1db06a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pg-override.c @@ -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 index 00000000000..1490c1db06a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pg.c @@ -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 index 00000000000..3771f19545a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/fentry-override.c @@ -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 index 00000000000..bd3db13d002 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/fentry.c @@ -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"); +}