diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/other')
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-2.C | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-3.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-5.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-6.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-7.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/offsetof6.C | 26 |
6 files changed, 43 insertions, 8 deletions
diff --git a/gcc/testsuite/g++.dg/other/i386-2.C b/gcc/testsuite/g++.dg/other/i386-2.C index 4c9579d07cd..1ef6b2775d8 100644 --- a/gcc/testsuite/g++.dg/other/i386-2.C +++ b/gcc/testsuite/g++.dg/other/i386-2.C @@ -1,8 +1,9 @@ -/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and +/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, xopintrin.h, mm3dnow.h and mm_malloc.h are usable with -O -pedantic-errors. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */ +/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */ #include <x86intrin.h> int dummy; + diff --git a/gcc/testsuite/g++.dg/other/i386-3.C b/gcc/testsuite/g++.dg/other/i386-3.C index b9e89169ccb..df33af8bbd9 100644 --- a/gcc/testsuite/g++.dg/other/i386-3.C +++ b/gcc/testsuite/g++.dg/other/i386-3.C @@ -1,6 +1,6 @@ -/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and +/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h, xopintrin.h and mm_malloc.h are usable with -O -fkeep-inline-functions. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */ +/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */ #include <x86intrin.h> diff --git a/gcc/testsuite/g++.dg/other/i386-5.C b/gcc/testsuite/g++.dg/other/i386-5.C index 6dcb2d3b0d0..383aae365bb 100644 --- a/gcc/testsuite/g++.dg/other/i386-5.C +++ b/gcc/testsuite/g++.dg/other/i386-5.C @@ -1,6 +1,6 @@ -/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and +/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, xopintrin.h, mm3dnow.h and mm_malloc.h are usable with -O -fkeep-inline-functions. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */ +/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */ #include <x86intrin.h> diff --git a/gcc/testsuite/g++.dg/other/i386-6.C b/gcc/testsuite/g++.dg/other/i386-6.C index 4c9579d07cd..2bd4609d671 100644 --- a/gcc/testsuite/g++.dg/other/i386-6.C +++ b/gcc/testsuite/g++.dg/other/i386-6.C @@ -1,7 +1,7 @@ -/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, mm3dnow.h and +/* Test that {,x,e,p,t,s,w,a,i}mmintrin.h, fma4intrin.h, xopintrin.h, mm3dnow.h and mm_malloc.h are usable with -O -pedantic-errors. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -maes -mpclmul" } */ +/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse4a -mfma4 -mxop -maes -mpclmul" } */ #include <x86intrin.h> diff --git a/gcc/testsuite/g++.dg/other/i386-7.C b/gcc/testsuite/g++.dg/other/i386-7.C new file mode 100644 index 00000000000..e2ad51e528d --- /dev/null +++ b/gcc/testsuite/g++.dg/other/i386-7.C @@ -0,0 +1,8 @@ +/* Test that x86intrin.h is usable with -O -pedantic-errors. */ +/* We were using SSE4.2 builtins without the extension available. */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O -pedantic-errors" } */ + +#include <x86intrin.h> + +int dummy; diff --git a/gcc/testsuite/g++.dg/other/offsetof6.C b/gcc/testsuite/g++.dg/other/offsetof6.C new file mode 100644 index 00000000000..b77d1b99a77 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/offsetof6.C @@ -0,0 +1,26 @@ +// Contributed by Dodji Seketeli <dodji@redhat.com> +// Origin PR c++/38699 +// { dg-do compile } + +template<class T> +struct A +{ + const T *p; +}; + +struct B +{ + A<int> a; +}; + +template class A<char>; + +void +f0 () +{ + __builtin_offsetof(A<char>, p); // OK + __builtin_offsetof(A<char>, p[1]); // { dg-error "non constant address" } + __builtin_offsetof(B, a.p); // OK + __builtin_offsetof(B, a.p[1]); // { dg-error "non constant address" } +} + |