diff options
author | Tom de Vries <tom@codesourcery.com> | 2017-05-01 14:15:33 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2017-05-01 14:15:33 +0000 |
commit | 723f4140da3d33c70b25941382bf345dd60ed18f (patch) | |
tree | 30e1b9452e5171de6a857174c8f05a7f4681bb22 | |
parent | dd03444ba5ad4ac3f5476084c2028851b5c94cca (diff) | |
download | gcc-723f4140da3d33c70b25941382bf345dd60ed18f.zip gcc-723f4140da3d33c70b25941382bf345dd60ed18f.tar.gz gcc-723f4140da3d33c70b25941382bf345dd60ed18f.tar.bz2 |
Add and use effective target rdrand
2017-05-01 Tom de Vries <tom@codesourcery.com>
PR testsuite/65941
* lib/target-supports.exp (check_effective_target_rdrand): New proc.
* g++.dg/other/pr59492.C: Require effective target rdrand.
From-SVN: r247438
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/pr59492.C | 1 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 14 |
3 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 818e002..f1c61a6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-05-01 Tom de Vries <tom@codesourcery.com> + + PR testsuite/65941 + * lib/target-supports.exp (check_effective_target_rdrand): New proc. + * g++.dg/other/pr59492.C: Require effective target rdrand. + 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de> * g++.dg/diagnostic/member-decl-1.C: New test. diff --git a/gcc/testsuite/g++.dg/other/pr59492.C b/gcc/testsuite/g++.dg/other/pr59492.C index 84bd255..92694ae 100644 --- a/gcc/testsuite/g++.dg/other/pr59492.C +++ b/gcc/testsuite/g++.dg/other/pr59492.C @@ -2,6 +2,7 @@ // { dg-options "-mx32 -fPIC" } // { dg-require-ifunc "" } // { dg-require-effective-target maybe_x32 } +// { dg-require-effective-target rdrand } void __throw_runtime_error(const char*) __attribute__((__noreturn__)); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 342af27..83e7f26 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8296,6 +8296,20 @@ proc check_effective_target_store_merge { } { return 0 } +# Return 1 if we're able to assemble rdrand + +proc check_effective_target_rdrand { } { + return [check_no_compiler_messages_nocache rdrand object { + unsigned int + __foo(void) + { + unsigned int val; + __builtin_ia32_rdrand32_step(&val); + return val; + } + } "-mrdrnd" ] +} + # Return 1 if the target supports coprocessor instructions: cdp, ldc, stc, mcr and # mrc. proc check_effective_target_arm_coproc1_ok_nocache { } { |