From: Martin Liska Date: Tue, 20 Nov 2018 12:07:53 +0000 (+0100) Subject: Move some i386 C++ tests into g++.target/i386. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b613740815fa921b1210f87aed3d01a00a59e8bf;p=gcc.git Move some i386 C++ tests into g++.target/i386. 2018-11-20 Martin Liska * pr57362.C: Move to g++.target/i386 folder. * pr57548.C: Likewise. * pr59492.C: Likewise. * pr82625.C: Likewise. * pr85329-2.C: Likewise. * pr85329.C: Likewise. From-SVN: r266312 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 099d464d10e..00475b8c5b9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2018-11-20 Martin Liska + + * pr57362.C: Move to g++.target/i386 folder. + * pr57548.C: Likewise. + * pr59492.C: Likewise. + * pr82625.C: Likewise. + * pr85329-2.C: Likewise. + * pr85329.C: Likewise. + 2018-11-20 Richard Biener PR tree-optimization/88069 diff --git a/gcc/testsuite/g++.dg/ext/pr57362.C b/gcc/testsuite/g++.dg/ext/pr57362.C deleted file mode 100644 index 07270946d55..00000000000 --- a/gcc/testsuite/g++.dg/ext/pr57362.C +++ /dev/null @@ -1,202 +0,0 @@ -/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-require-ifunc "" } */ - -__attribute__((target("default"))) -int foo(void) { return 1; } -__attribute__((target("128bit-long-double"))) -int foo(void) { return 1; } -__attribute__((target("80387"))) -int foo(void) { return 1; } -__attribute__((target("96bit-long-double"))) -int foo(void) { return 1; } -__attribute__((target("long-double-80"))) -int foo(void) { return 1; } -__attribute__((target("long-double-64"))) -int foo(void) { return 1; } -__attribute__((target("accumulate-outgoing-args"))) -int foo(void) { return 1; } -__attribute__((target("align-double"))) -int foo(void) { return 1; } -__attribute__((target("align-stringops"))) -int foo(void) { return 1; } -__attribute__((target("fancy-math-387"))) -int foo(void) { return 1; } -__attribute__((target("force-drap"))) -int foo(void) { return 1; } -__attribute__((target("fp-ret-in-387"))) -int foo(void) { return 1; } -__attribute__((target("hard-float"))) -int foo(void) { return 1; } -__attribute__((target("ieee-fp"))) -int foo(void) { return 1; } -__attribute__((target("inline-all-stringops"))) -int foo(void) { return 1; } -__attribute__((target("inline-stringops-dynamically"))) -int foo(void) { return 1; } -__attribute__((target("intel-syntax"))) -int foo(void) { return 1; } -__attribute__((target("ms-bitfields"))) -int foo(void) { return 1; } -__attribute__((target("no-align-stringops"))) -int foo(void) { return 1; } -__attribute__((target("no-fancy-math-387"))) -int foo(void) { return 1; } -__attribute__((target("no-push-args"))) -int foo(void) { return 1; } -__attribute__((target("no-red-zone"))) -int foo(void) { return 1; } -__attribute__((target("omit-leaf-frame-pointer"))) -int foo(void) { return 1; } -__attribute__((target("pc32"))) -int foo(void) { return 1; } -__attribute__((target("pc64"))) -int foo(void) { return 1; } -__attribute__((target("pc80"))) -int foo(void) { return 1; } -__attribute__((target("push-args"))) -int foo(void) { return 1; } -__attribute__((target("red-zone"))) -int foo(void) { return 1; } -__attribute__((target("rtd"))) -int foo(void) { return 1; } -__attribute__((target("soft-float"))) -int foo(void) { return 1; } -__attribute__((target("sseregparm"))) -int foo(void) { return 1; } -__attribute__((target("stackrealign"))) -int foo(void) { return 1; } -__attribute__((target("stack-arg-probe"))) -int foo(void) { return 1; } -__attribute__((target("tls-direct-seg-refs"))) -int foo(void) { return 1; } -__attribute__((target("vect8-ret-in-mem"))) -int foo(void) { return 1; } -__attribute__((target("recip"))) -int foo(void) { return 1; } -__attribute__((target("cld"))) -int foo(void) { return 1; } -__attribute__((target("vzeroupper"))) -int foo(void) { return 1; } -__attribute__((target("dispatch-scheduler"))) -int foo(void) { return 1; } -__attribute__((target("prefer-avx128"))) -int foo(void) { return 1; } -__attribute__((target("prefer-vector-width=128"))) -int foo(void) { return 1; } -__attribute__((target("prefer-vector-width=256"))) -int foo(void) { return 1; } -__attribute__((target("32"))) -int foo(void) { return 1; } -__attribute__((target("64"))) -int foo(void) { return 1; } -__attribute__((target("x32"))) -int foo(void) { return 1; } -__attribute__((target("mmx"))) -int foo(void) { return 1; } -__attribute__((target("3dnow"))) -int foo(void) { return 1; } -__attribute__((target("3dnowa"))) -int foo(void) { return 1; } -__attribute__((target("sse"))) -int foo(void) { return 1; } -__attribute__((target("sse2"))) -int foo(void) { return 1; } -__attribute__((target("sse3"))) -int foo(void) { return 1; } -__attribute__((target("ssse3"))) -int foo(void) { return 1; } -__attribute__((target("sse4.1"))) -int foo(void) { return 1; } -__attribute__((target("sse4.2"))) -int foo(void) { return 1; } -__attribute__((target("sse4"))) -int foo(void) { return 1; } -__attribute__((target("no-sse4"))) -int foo(void) { return 1; } -__attribute__((target("sse5"))) -int foo(void) { return 1; } -__attribute__((target("avx"))) -int foo(void) { return 1; } -__attribute__((target("avx2"))) -int foo(void) { return 1; } -__attribute__((target("fma"))) -int foo(void) { return 1; } -__attribute__((target("sse4a"))) -int foo(void) { return 1; } -__attribute__((target("fma4"))) -int foo(void) { return 1; } -__attribute__((target("xop"))) -int foo(void) { return 1; } -__attribute__((target("lwp"))) -int foo(void) { return 1; } -__attribute__((target("abm"))) -int foo(void) { return 1; } -__attribute__((target("popcnt"))) -int foo(void) { return 1; } -__attribute__((target("bmi"))) -int foo(void) { return 1; } -__attribute__((target("bmi2"))) -int foo(void) { return 1; } -__attribute__((target("lzcnt"))) -int foo(void) { return 1; } -__attribute__((target("hle"))) -int foo(void) { return 1; } -__attribute__((target("rdseed"))) -int foo(void) { return 1; } -__attribute__((target("prfchw"))) -int foo(void) { return 1; } -__attribute__((target("adx"))) -int foo(void) { return 1; } -__attribute__((target("fxsr"))) -int foo(void) { return 1; } -__attribute__((target("xsave"))) -int foo(void) { return 1; } -__attribute__((target("xsaveopt"))) -int foo(void) { return 1; } -__attribute__((target("tbm"))) -int foo(void) { return 1; } -__attribute__((target("cx16"))) -int foo(void) { return 1; } -__attribute__((target("sahf"))) -int foo(void) { return 1; } -__attribute__((target("movbe"))) -int foo(void) { return 1; } -__attribute__((target("crc32"))) -int foo(void) { return 1; } -__attribute__((target("aes"))) -int foo(void) { return 1; } -__attribute__((target("pclmul"))) -int foo(void) { return 1; } -__attribute__((target("sse2avx"))) -int foo(void) { return 1; } -__attribute__((target("fsgsbase"))) -int foo(void) { return 1; } -__attribute__((target("rdrnd"))) -int foo(void) { return 1; } -__attribute__((target("f16c"))) -int foo(void) { return 1; } -__attribute__((target("fentry"))) -int foo(void) { return 1; } -__attribute__((target("8bit-idiv"))) -int foo(void) { return 1; } -__attribute__((target("avx256-split-unaligned-load"))) -int foo(void) { return 1; } -__attribute__((target("avx256-split-unaligned-store"))) -int foo(void) { return 1; } -__attribute__((target("rtm"))) -int foo(void) { return 1; } -//--------------- - -#include - int main (void) - { - int result; - result = foo(); - printf("Result is %d\n", result); - return result; - } - -/* { dg-prune-output "attribute.* is unknown" } */ -/* { dg-prune-output "missing 'target' attribute*" } */ -/* { dg-prune-output "redefinition of 'int foo" } */ -/* { dg-prune-output "No dispatcher found for" } */ diff --git a/gcc/testsuite/g++.dg/ext/pr57548.C b/gcc/testsuite/g++.dg/ext/pr57548.C deleted file mode 100644 index 1cc728d294c..00000000000 --- a/gcc/testsuite/g++.dg/ext/pr57548.C +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-require-ifunc "" } */ - -int fum (); // Extra declaration that is merged with the second one. -int fum () __attribute__ ((target("default"))); - - -int fum () __attribute__((target( "mmx"))); -int fum () __attribute__((target( "popcnt"))); -int fum () __attribute__((target( "sse"))); -int fum () __attribute__((target( "sse2"))); -int fum () __attribute__((target( "sse3"))); -int fum () __attribute__((target( "ssse3"))); -int fum () __attribute__((target( "sse4.1"))); -int fum () __attribute__((target( "sse4.2"))); -int fum () __attribute__((target( "avx"))); -int fum () __attribute__((target( "avx2"))); - -int fum () __attribute__((target("arch=core2"))); -int fum () __attribute__((target("arch=corei7"))); -int fum () __attribute__((target("arch=atom"))); - -int (*p)() = &fum; - -int j = fum(); diff --git a/gcc/testsuite/g++.dg/ext/pr82625.C b/gcc/testsuite/g++.dg/ext/pr82625.C deleted file mode 100644 index 59b174f8c51..00000000000 --- a/gcc/testsuite/g++.dg/ext/pr82625.C +++ /dev/null @@ -1,37 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-ifunc "" } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ -/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ - -__attribute__ ((target ("default"))) -static unsigned foo(const char *buf, unsigned size) { - return 1; -} - -__attribute__ ((target ("avx"))) -static unsigned foo(const char *buf, unsigned size) { - return 2; -} - -__attribute__ ((target ("default"))) -unsigned bar() { - char buf[4096]; - unsigned acc = 0; - for (int i = 0; i < sizeof(buf); i++) { - acc += foo(&buf[i], 1); - } - return acc; -} - -__attribute__ ((target ("avx"))) -unsigned bar() { - char buf[4096]; - unsigned acc = 0; - for (int i = 0; i < sizeof(buf); i++) { - acc += foo(&buf[i], 1); - } - return acc; -} - -/* { dg-final { scan-tree-dump-times "return 4096;" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-times "return 8192;" 1 "optimized" } } */ diff --git a/gcc/testsuite/g++.dg/ext/pr85329-2.C b/gcc/testsuite/g++.dg/ext/pr85329-2.C deleted file mode 100644 index 24622d404f7..00000000000 --- a/gcc/testsuite/g++.dg/ext/pr85329-2.C +++ /dev/null @@ -1,22 +0,0 @@ -/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-require-ifunc "" } */ - -class b -{ -public: - __attribute__ ((target ("aes"))) b () {} - __attribute__ ((target ("default"))) b () {} -}; -class c -{ - b d; -}; -void -fn1 () -{ - c a; -} -__attribute__ ((target_clones ("sse", "default"))) void -e () -{ -} diff --git a/gcc/testsuite/g++.dg/ext/pr85329.C b/gcc/testsuite/g++.dg/ext/pr85329.C deleted file mode 100644 index fb77e42cd78..00000000000 --- a/gcc/testsuite/g++.dg/ext/pr85329.C +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-require-ifunc "" } */ - -struct a -{ - __attribute__((target_clones("sse", "default"))) void operator^=(a) {} -} * b; - -class c { -public: - a *d(); -}; - -class f { - void g(); - c e; -}; - -void f::g() { *e.d() ^= b[0]; } diff --git a/gcc/testsuite/g++.dg/other/pr59492.C b/gcc/testsuite/g++.dg/other/pr59492.C deleted file mode 100644 index 92694ae6dde..00000000000 --- a/gcc/testsuite/g++.dg/other/pr59492.C +++ /dev/null @@ -1,19 +0,0 @@ -// { dg-do assemble { target { { i?86-*-* x86_64-*-* } && fpic } } } -// { 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__)); -unsigned int -__attribute__ ((target("rdrnd"))) -__x86_rdrand(void) -{ - unsigned int retries = 100; - unsigned int val; - while (__builtin_ia32_rdrand32_step(&val) == 0) - if (--retries == 0) - __throw_runtime_error(("random_device::__x86_rdrand(void)")); - return val; -} diff --git a/gcc/testsuite/g++.target/i386/pr57362.C b/gcc/testsuite/g++.target/i386/pr57362.C new file mode 100644 index 00000000000..8c07e857525 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr57362.C @@ -0,0 +1,202 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ + +__attribute__((target("default"))) +int foo(void) { return 1; } +__attribute__((target("128bit-long-double"))) +int foo(void) { return 1; } +__attribute__((target("80387"))) +int foo(void) { return 1; } +__attribute__((target("96bit-long-double"))) +int foo(void) { return 1; } +__attribute__((target("long-double-80"))) +int foo(void) { return 1; } +__attribute__((target("long-double-64"))) +int foo(void) { return 1; } +__attribute__((target("accumulate-outgoing-args"))) +int foo(void) { return 1; } +__attribute__((target("align-double"))) +int foo(void) { return 1; } +__attribute__((target("align-stringops"))) +int foo(void) { return 1; } +__attribute__((target("fancy-math-387"))) +int foo(void) { return 1; } +__attribute__((target("force-drap"))) +int foo(void) { return 1; } +__attribute__((target("fp-ret-in-387"))) +int foo(void) { return 1; } +__attribute__((target("hard-float"))) +int foo(void) { return 1; } +__attribute__((target("ieee-fp"))) +int foo(void) { return 1; } +__attribute__((target("inline-all-stringops"))) +int foo(void) { return 1; } +__attribute__((target("inline-stringops-dynamically"))) +int foo(void) { return 1; } +__attribute__((target("intel-syntax"))) +int foo(void) { return 1; } +__attribute__((target("ms-bitfields"))) +int foo(void) { return 1; } +__attribute__((target("no-align-stringops"))) +int foo(void) { return 1; } +__attribute__((target("no-fancy-math-387"))) +int foo(void) { return 1; } +__attribute__((target("no-push-args"))) +int foo(void) { return 1; } +__attribute__((target("no-red-zone"))) +int foo(void) { return 1; } +__attribute__((target("omit-leaf-frame-pointer"))) +int foo(void) { return 1; } +__attribute__((target("pc32"))) +int foo(void) { return 1; } +__attribute__((target("pc64"))) +int foo(void) { return 1; } +__attribute__((target("pc80"))) +int foo(void) { return 1; } +__attribute__((target("push-args"))) +int foo(void) { return 1; } +__attribute__((target("red-zone"))) +int foo(void) { return 1; } +__attribute__((target("rtd"))) +int foo(void) { return 1; } +__attribute__((target("soft-float"))) +int foo(void) { return 1; } +__attribute__((target("sseregparm"))) +int foo(void) { return 1; } +__attribute__((target("stackrealign"))) +int foo(void) { return 1; } +__attribute__((target("stack-arg-probe"))) +int foo(void) { return 1; } +__attribute__((target("tls-direct-seg-refs"))) +int foo(void) { return 1; } +__attribute__((target("vect8-ret-in-mem"))) +int foo(void) { return 1; } +__attribute__((target("recip"))) +int foo(void) { return 1; } +__attribute__((target("cld"))) +int foo(void) { return 1; } +__attribute__((target("vzeroupper"))) +int foo(void) { return 1; } +__attribute__((target("dispatch-scheduler"))) +int foo(void) { return 1; } +__attribute__((target("prefer-avx128"))) +int foo(void) { return 1; } +__attribute__((target("prefer-vector-width=128"))) +int foo(void) { return 1; } +__attribute__((target("prefer-vector-width=256"))) +int foo(void) { return 1; } +__attribute__((target("32"))) +int foo(void) { return 1; } +__attribute__((target("64"))) +int foo(void) { return 1; } +__attribute__((target("x32"))) +int foo(void) { return 1; } +__attribute__((target("mmx"))) +int foo(void) { return 1; } +__attribute__((target("3dnow"))) +int foo(void) { return 1; } +__attribute__((target("3dnowa"))) +int foo(void) { return 1; } +__attribute__((target("sse"))) +int foo(void) { return 1; } +__attribute__((target("sse2"))) +int foo(void) { return 1; } +__attribute__((target("sse3"))) +int foo(void) { return 1; } +__attribute__((target("ssse3"))) +int foo(void) { return 1; } +__attribute__((target("sse4.1"))) +int foo(void) { return 1; } +__attribute__((target("sse4.2"))) +int foo(void) { return 1; } +__attribute__((target("sse4"))) +int foo(void) { return 1; } +__attribute__((target("no-sse4"))) +int foo(void) { return 1; } +__attribute__((target("sse5"))) +int foo(void) { return 1; } +__attribute__((target("avx"))) +int foo(void) { return 1; } +__attribute__((target("avx2"))) +int foo(void) { return 1; } +__attribute__((target("fma"))) +int foo(void) { return 1; } +__attribute__((target("sse4a"))) +int foo(void) { return 1; } +__attribute__((target("fma4"))) +int foo(void) { return 1; } +__attribute__((target("xop"))) +int foo(void) { return 1; } +__attribute__((target("lwp"))) +int foo(void) { return 1; } +__attribute__((target("abm"))) +int foo(void) { return 1; } +__attribute__((target("popcnt"))) +int foo(void) { return 1; } +__attribute__((target("bmi"))) +int foo(void) { return 1; } +__attribute__((target("bmi2"))) +int foo(void) { return 1; } +__attribute__((target("lzcnt"))) +int foo(void) { return 1; } +__attribute__((target("hle"))) +int foo(void) { return 1; } +__attribute__((target("rdseed"))) +int foo(void) { return 1; } +__attribute__((target("prfchw"))) +int foo(void) { return 1; } +__attribute__((target("adx"))) +int foo(void) { return 1; } +__attribute__((target("fxsr"))) +int foo(void) { return 1; } +__attribute__((target("xsave"))) +int foo(void) { return 1; } +__attribute__((target("xsaveopt"))) +int foo(void) { return 1; } +__attribute__((target("tbm"))) +int foo(void) { return 1; } +__attribute__((target("cx16"))) +int foo(void) { return 1; } +__attribute__((target("sahf"))) +int foo(void) { return 1; } +__attribute__((target("movbe"))) +int foo(void) { return 1; } +__attribute__((target("crc32"))) +int foo(void) { return 1; } +__attribute__((target("aes"))) +int foo(void) { return 1; } +__attribute__((target("pclmul"))) +int foo(void) { return 1; } +__attribute__((target("sse2avx"))) +int foo(void) { return 1; } +__attribute__((target("fsgsbase"))) +int foo(void) { return 1; } +__attribute__((target("rdrnd"))) +int foo(void) { return 1; } +__attribute__((target("f16c"))) +int foo(void) { return 1; } +__attribute__((target("fentry"))) +int foo(void) { return 1; } +__attribute__((target("8bit-idiv"))) +int foo(void) { return 1; } +__attribute__((target("avx256-split-unaligned-load"))) +int foo(void) { return 1; } +__attribute__((target("avx256-split-unaligned-store"))) +int foo(void) { return 1; } +__attribute__((target("rtm"))) +int foo(void) { return 1; } +//--------------- + +#include + int main (void) + { + int result; + result = foo(); + printf("Result is %d\n", result); + return result; + } + +/* { dg-prune-output "attribute.* is unknown" } */ +/* { dg-prune-output "missing 'target' attribute*" } */ +/* { dg-prune-output "redefinition of 'int foo" } */ +/* { dg-prune-output "No dispatcher found for" } */ diff --git a/gcc/testsuite/g++.target/i386/pr57548.C b/gcc/testsuite/g++.target/i386/pr57548.C new file mode 100644 index 00000000000..e027f7d432f --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr57548.C @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ + +int fum (); // Extra declaration that is merged with the second one. +int fum () __attribute__ ((target("default"))); + + +int fum () __attribute__((target( "mmx"))); +int fum () __attribute__((target( "popcnt"))); +int fum () __attribute__((target( "sse"))); +int fum () __attribute__((target( "sse2"))); +int fum () __attribute__((target( "sse3"))); +int fum () __attribute__((target( "ssse3"))); +int fum () __attribute__((target( "sse4.1"))); +int fum () __attribute__((target( "sse4.2"))); +int fum () __attribute__((target( "avx"))); +int fum () __attribute__((target( "avx2"))); + +int fum () __attribute__((target("arch=core2"))); +int fum () __attribute__((target("arch=corei7"))); +int fum () __attribute__((target("arch=atom"))); + +int (*p)() = &fum; + +int j = fum(); diff --git a/gcc/testsuite/g++.target/i386/pr59492.C b/gcc/testsuite/g++.target/i386/pr59492.C new file mode 100644 index 00000000000..25393d7a3c2 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr59492.C @@ -0,0 +1,19 @@ +// { dg-do assemble { target { fpic } } } +// { 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__)); +unsigned int +__attribute__ ((target("rdrnd"))) +__x86_rdrand(void) +{ + unsigned int retries = 100; + unsigned int val; + while (__builtin_ia32_rdrand32_step(&val) == 0) + if (--retries == 0) + __throw_runtime_error(("random_device::__x86_rdrand(void)")); + return val; +} diff --git a/gcc/testsuite/g++.target/i386/pr82625.C b/gcc/testsuite/g++.target/i386/pr82625.C new file mode 100644 index 00000000000..47bd2df1104 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr82625.C @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +__attribute__ ((target ("default"))) +static unsigned foo(const char *buf, unsigned size) { + return 1; +} + +__attribute__ ((target ("avx"))) +static unsigned foo(const char *buf, unsigned size) { + return 2; +} + +__attribute__ ((target ("default"))) +unsigned bar() { + char buf[4096]; + unsigned acc = 0; + for (int i = 0; i < sizeof(buf); i++) { + acc += foo(&buf[i], 1); + } + return acc; +} + +__attribute__ ((target ("avx"))) +unsigned bar() { + char buf[4096]; + unsigned acc = 0; + for (int i = 0; i < sizeof(buf); i++) { + acc += foo(&buf[i], 1); + } + return acc; +} + +/* { dg-final { scan-tree-dump-times "return 4096;" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "return 8192;" 1 "optimized" } } */ diff --git a/gcc/testsuite/g++.target/i386/pr85329-2.C b/gcc/testsuite/g++.target/i386/pr85329-2.C new file mode 100644 index 00000000000..e58ab4c5955 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr85329-2.C @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ + +class b +{ +public: + __attribute__ ((target ("aes"))) b () {} + __attribute__ ((target ("default"))) b () {} +}; +class c +{ + b d; +}; +void +fn1 () +{ + c a; +} +__attribute__ ((target_clones ("sse", "default"))) void +e () +{ +} diff --git a/gcc/testsuite/g++.target/i386/pr85329.C b/gcc/testsuite/g++.target/i386/pr85329.C new file mode 100644 index 00000000000..4a0ebf29c07 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr85329.C @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ + +struct a +{ + __attribute__((target_clones("sse", "default"))) void operator^=(a) {} +} * b; + +class c { +public: + a *d(); +}; + +class f { + void g(); + c e; +}; + +void f::g() { *e.d() ^= b[0]; }