re PR testsuite/52641 (Test cases fail for 16-bit int targets)
authorJoern Rennecke <joern.rennecke@embecosm.com>
Wed, 14 Aug 2013 18:39:59 +0000 (18:39 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Wed, 14 Aug 2013 18:39:59 +0000 (19:39 +0100)
        PR testsuite/52641
        * c-c++-common/simulate-thread/bitfields-2.c: Run test only for
        target { ! int16 }.
        * gcc.dg/tree-ssa/pr54245.c: Do slsr scan only for target { ! int16 }.
        * gcc.dg/tree-ssa/slsr-1.c: Adjust multiplicators to scan for for
        target { int16 }.  Restrict existing tests to target { int32 }
        where appropriate.
        * gcc.dg/tree-ssa/slsr-2.c, gcc.dg/tree-ssa/slsr-27.c: Likewise.
        * gcc.dg/tree-ssa/slsr-28.c, gcc.dg/tree-ssa/slsr-29.c: Likewise.
        * gcc.dg/tree-ssa/slsr-3.c, gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise.
        * lib/target-supports.exp (check_effective_target_int32): New proc.

From-SVN: r201743

gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/simulate-thread/bitfields-2.c
gcc/testsuite/gcc.dg/tree-ssa/pr54245.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-1.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-2.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-27.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-28.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-29.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-3.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
gcc/testsuite/lib/target-supports.exp

index 60ab9dd..35bd4e8 100644 (file)
        * c-c++-common/scal-to-vec1.c: Add !int16 and large_double conditions
        to tests that assume int/double are larger than short/float.
 
+       PR testsuite/52641
+       * c-c++-common/simulate-thread/bitfields-2.c: Run test only for
+       target { ! int16 }.
+       * gcc.dg/tree-ssa/pr54245.c: Do slsr scan only for target { ! int16 }.
+       * gcc.dg/tree-ssa/slsr-1.c: Adjust multiplicators to scan for for
+       target { int16 }.  Restrict existing tests to target { int32 }
+       where appropriate.
+       * gcc.dg/tree-ssa/slsr-2.c, gcc.dg/tree-ssa/slsr-27.c: Likewise.
+       * gcc.dg/tree-ssa/slsr-28.c, gcc.dg/tree-ssa/slsr-29.c: Likewise.
+       * gcc.dg/tree-ssa/slsr-3.c, gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise.
+       * lib/target-supports.exp (check_effective_target_int32): New proc.
+
+
 2013-08-14  Janis Johnson  <janisjo@codesourcery.com>
 
        * gcc.target/arm/pr19599.c: Skip for -mthumb.
index 392f779..0b29ffb 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do link } */
+/* { dg-do link { target { ! int16 } } } */
 /* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
index 0e11d06..daca042 100644 (file)
@@ -45,5 +45,5 @@ int main(void)
 /* For now, disable inserting an initializer when the multiplication will
    take place in a smaller type than originally.  This test may be deleted
    in future when this case is handled more precisely.  */
-/* { dg-final { scan-tree-dump-times "Inserting initializer" 0 "slsr" } } */
+/* { dg-final { scan-tree-dump-times "Inserting initializer" 0 "slsr" { target { ! int16 } } } } */
 /* { dg-final { cleanup-tree-dump "slsr" } } */
index 38da179..e8c0ff0 100644 (file)
@@ -14,7 +14,9 @@ f (int *p, unsigned int n)
     foo (*(p + 48 + n * 4));
 }
 
-/* { dg-final { scan-tree-dump-times "\\+ 128|\\, 128>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 128|\\, 128>" 1 "optimized" { target { int32plus } } } } */
 /* { dg-final { scan-tree-dump-times "\\+ 64|\\, 64>" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 192|\\, 192>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 32|\\, 32>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 192|\\, 192>" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 96|\\, 96>" 1 "optimized" { target { int16 } } } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
index c6bb3e0..56697ff 100644 (file)
@@ -11,6 +11,8 @@ f (int *p, int n)
   foo (*(p + 16 + n * 4));
 }
 
-/* { dg-final { scan-tree-dump-times "\\+ 144|\\, 144>" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 96|\\, 96>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 144|\\, 144>" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 72|\\, 72>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 96|\\, 96>" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 48|\\, 48>" 1 "optimized" { target { int16 } } } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
index eb5734a..c664262 100644 (file)
@@ -16,7 +16,8 @@ f (struct x *p, unsigned int n)
   foo (p->a[n], p->c[n], p->b[n]);
 }
 
-/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" } } */
+/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom2" { target { int16 } } } } */
 /* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+;" 1 "dom2" } } */
 /* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 3 "dom2" } } */
 /* { dg-final { cleanup-tree-dump "dom2" } } */
index 7e7c751..c4dbf54 100644 (file)
@@ -20,7 +20,8 @@ f (struct x *p, unsigned int n)
     foo (p->b[n], p->a[n], p->c[n]);
 }
 
-/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" } } */
+/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom2" { target { int16 } } } } */
 /* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+" 1 "dom2" } } */
 /* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom2" } } */
 /* { dg-final { cleanup-tree-dump "dom2" } } */
index 2a8fe0e..c8e7a5e 100644 (file)
@@ -22,7 +22,8 @@ f (struct x *p, unsigned int n)
     }
 }
 
-/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" } } */
+/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom2" { target { int16 } } } } */
 /* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+" 1 "dom2" } } */
 /* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom2" } } */
 /* { dg-final { cleanup-tree-dump "dom2" } } */
index 32edf2b..89d1d2e 100644 (file)
@@ -15,8 +15,11 @@ foo (int a[], int b[], int i)
   return i;
 }
 
-/* { dg-final { scan-tree-dump-times "\\* 4" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\* 4" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 2|\\, 2>" 5 "optimized" { target { int16 } } } } */
 /* { dg-final { scan-tree-dump-times "\\+ 4|\\, 4>" 2 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 8|\\, 8>" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 12|\\, 12>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 8|\\, 8>" 1 "optimized" { target { int32plus } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 6|\\, 6>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 12|\\, 12>" 1 "optimized" { target { int32 } } } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
index fb4af2d..8b95b0c 100644 (file)
@@ -15,5 +15,6 @@ int foo (void)
   return *x;
 }
 
-/* { dg-final { scan-tree-dump "MEM\\\[\\\(int \\\*\\\)&a \\\+ 4B\\\]" "ccp1" } } */
+/* { dg-final { scan-tree-dump "MEM\\\[\\\(int \\\*\\\)&a \\\+ 2B\\\]" "ccp1" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump "MEM\\\[\\\(int \\\*\\\)&a \\\+ 4B\\\]" "ccp1" { target { int32 } } } } */
 /* { dg-final { cleanup-tree-dump "ccp1" } } */
index 0fb135c..bcf060f 100644 (file)
@@ -1723,6 +1723,15 @@ proc check_effective_target_x32 { } {
     }]
 }
 
+# Return 1 if we're generating 32-bit integers using default
+# options, 0 otherwise.
+
+proc check_effective_target_int32 { } {
+    return [check_no_compiler_messages int32 object {
+       int dummy[sizeof (int) == 4 ? 1 : -1];
+    }]
+}
+
 # Return 1 if we're generating 32-bit or larger integers using default
 # options, 0 otherwise.