Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / mips / dsp-ctrl.c
blob4bf449b86ca4b5fcf49ca7095b1045abd1f3608b
1 /* { dg-do run } */
2 /* { dg-options "-mdsp -mgp32" } */
4 extern void abort (void);
5 extern void exit (int);
7 NOMIPS16 void __attribute__ ((noinline))
8 test1 (int i)
10 __builtin_mips_wrdsp (i, 63);
13 NOMIPS16 void __attribute__ ((noinline))
14 test2 ()
16 long long a = 0;
17 __builtin_mips_extpdp (a, 3);
20 NOMIPS16 void __attribute__ ((noinline))
21 test3 (int i)
23 long long a = 0;
24 __builtin_mips_extpdp (a, i);
27 NOMIPS16 void __attribute__ ((noinline))
28 test4 ()
30 long long a = 0;
31 int i = 0;
32 __builtin_mips_mthlip (a, i);
35 NOMIPS16 int
36 main ()
38 int cntl;
40 /* Test 1: wrdsp */
41 __builtin_mips_wrdsp (0,63);
42 test1 (63);
43 cntl = __builtin_mips_rddsp (63);
44 if (cntl != 63)
45 abort ();
47 /* Test 2: extpdp */
48 __builtin_mips_wrdsp (63,63);
49 test2 ();
50 cntl = __builtin_mips_rddsp (63);
51 if (cntl != 59)
52 abort ();
54 /* Test 3: extpdpv */
55 __builtin_mips_wrdsp (63,63);
56 test3 (10);
57 cntl = __builtin_mips_rddsp (63);
58 if (cntl != 52)
59 abort ();
61 /* Test 4: mthlip */
62 __builtin_mips_wrdsp (8,63);
63 test4 ();
64 cntl = __builtin_mips_rddsp (63);
65 if (cntl != 40)
66 abort ();
68 exit (0);