diff options
author | Wei Mi <wmi@gcc.gnu.org> | 2014-08-20 16:52:03 +0000 |
---|---|---|
committer | Wei Mi <wmi@gcc.gnu.org> | 2014-08-20 16:52:03 +0000 |
commit | b7a95a1acfbc0f69c4d09406a3b039ab5867a420 (patch) | |
tree | f67f15e7fbff310f01977c1ef3e56a1a3c3c941a | |
parent | 58041fe6cf11a9b95a79e6bf694fe37e33d41e6f (diff) | |
download | gcc-b7a95a1acfbc0f69c4d09406a3b039ab5867a420.zip gcc-b7a95a1acfbc0f69c4d09406a3b039ab5867a420.tar.gz gcc-b7a95a1acfbc0f69c4d09406a3b039ab5867a420.tar.bz2 |
Miss to "svn add" test files in r214233 before commit.
From-SVN: r214234
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr60449_0.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr60449_1.c | 76 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr61776.c | 27 |
3 files changed, 133 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/lto/pr60449_0.c b/gcc/testsuite/gcc.dg/lto/pr60449_0.c new file mode 100644 index 0000000..a430830 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr60449_0.c @@ -0,0 +1,30 @@ +/* { dg-lto-do link } */ + +extern int printf (const char *__restrict __format, ...); +typedef long int __time_t; +typedef long int __suseconds_t; + +struct timeval + { + __time_t tv_sec; + __suseconds_t tv_usec; + }; + +struct timezone + { + int tz_minuteswest; + int tz_dsttime; + }; +typedef struct timezone *__restrict __timezone_ptr_t; + +extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz); + +int bar (void) +{ + struct timeval tv; + struct timezone tz; + + gettimeofday (&tv, &tz); + printf ("This is from bar %i\n", tz.tz_dsttime); + return 5; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr60449_1.c b/gcc/testsuite/gcc.dg/lto/pr60449_1.c new file mode 100644 index 0000000..ddc2529 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr60449_1.c @@ -0,0 +1,76 @@ +extern int printf (const char *__restrict __format, ...); +typedef long int __time_t; +typedef long int __suseconds_t; +struct timeval + { + __time_t tv_sec; + __suseconds_t tv_usec; + }; +struct timezone + { + int tz_minuteswest; + int tz_dsttime; + }; +typedef struct timezone *__restrict __timezone_ptr_t; +extern int gettimeofday (struct timeval *__restrict __tv, + __timezone_ptr_t __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +typedef long int __jmp_buf[8]; +typedef struct + { + unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; + } __sigset_t; +struct __jmp_buf_tag + { + __jmp_buf __jmpbuf; + int __mask_was_saved; + __sigset_t __saved_mask; + }; +typedef struct __jmp_buf_tag jmp_buf[1]; + +extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__)); +extern void longjmp (struct __jmp_buf_tag __env[1], int __val) + __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); + +extern int bar (void); + +int __attribute__ ((noinline, noclone)) +get_input (void) +{ + return 0; +} + +static jmp_buf buf; + +int foo (void) +{ + if (get_input ()) + longjmp(buf, 1); + return 0; +} + +volatile int z; + + +int main (void) +{ + struct timeval tv; + struct timezone tz; + + bar(); + if (setjmp (buf)) + return 1; + + if (!get_input ()) + { + gettimeofday (&tv, &tz); + z = 0; + printf ("This is from main %i\n", tz.tz_dsttime); + } + + foo (); + bar (); + bar (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr61776.c b/gcc/testsuite/gcc.dg/pr61776.c new file mode 100644 index 0000000..8768c54 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr61776.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fprofile-generate" } */ + +#include <setjmp.h> + +int cond1, cond2; + +int goo() __attribute__((noinline)); + +int goo() { + if (cond1) + return 1; + else + return 2; +} + +jmp_buf env; +int foo() { + int a; + + setjmp(env); + if (cond2) + a = goo(); + else + a = 3; + return a; +} |