1 /* { dg-do run { target { i?86-*-* x86_64-*-* } } } */
2 /* { dg-options "-g" } */
4 typedef __SIZE_TYPE__ size_t;
6 extern void *memcpy (void *, const void *, size_t);
8 __attribute__((noinline, noclone)) void
9 f1 (double a, double b, double c, float d, float e, int f, unsigned int g, long long h, unsigned long long i)
11 double j = d; /* { dg-final { gdb-test 29 "j" "4" } } */
12 long long l; /* { dg-final { gdb-test 29 "l" "4616189618054758400" } } */
13 memcpy (&l, &j, sizeof (l));
14 long long m; /* { dg-final { gdb-test 29 "m" "4613937818241073152" } } */
15 memcpy (&m, &c, sizeof (l));
16 float n = i; /* { dg-final { gdb-test 29 "n" "9" } } */
17 double o = h; /* { dg-final { gdb-test 29 "o" "8" } } */
18 float p = g; /* { dg-final { gdb-test 29 "p" "7" } } */
19 double q = f; /* { dg-final { gdb-test 29 "q" "6" } } */
20 unsigned long long r = a; /* { dg-final { gdb-test 29 "r" "1" } } */
21 long long s = c; /* { dg-final { gdb-test 29 "s" "3" } } */
22 unsigned t = d; /* { dg-final { gdb-test 29 "t" "4" } } */
23 int u = b; /* { dg-final { gdb-test 29 "u" "2" } } */
24 float v = a; /* { dg-final { gdb-test 29 "v" "1" } } */
25 double w = d / 4.0; /* { dg-final { gdb-test 29 "w" "1" } } */
26 double x = a + b + 1.0; /* { dg-final { gdb-test 29 "x" "4" } } */
27 double y = b + c + 2.0; /* { dg-final { gdb-test 29 "y" "7" } } */
28 float z = d + e + 3.0f; /* { dg-final { xfail-gdb-test 29 "z" "12" "x86_64-*-*"} } */
32 __attribute__((noinline, noclone)) void
33 f2 (double a, double b, double c, float d, float e, int f, unsigned int g, long long h, unsigned long long i)
35 double j = d; /* { dg-final { gdb-test 53 "j" "4" } } */
36 long long l; /* { dg-final { gdb-test 53 "l" "4616189618054758400" } } */
37 memcpy (&l, &j, sizeof (l));
38 long long m; /* { dg-final { gdb-test 53 "m" "4613937818241073152" } } */
39 memcpy (&m, &c, sizeof (l));
40 float n = i; /* { dg-final { xfail-gdb-test 53 "n" "9" } } */
41 double o = h; /* { dg-final { xfail-gdb-test 53 "o" "8" } } */
42 float p = g; /* { dg-final { gdb-test 53 "p" "7" } } */
43 double q = f; /* { dg-final { gdb-test 53 "q" "6" } } */
44 unsigned long long r = a; /* { dg-final { gdb-test 53 "r" "1" } } */
45 long long s = c; /* { dg-final { gdb-test 53 "s" "3" } } */
46 unsigned t = d; /* { dg-final { gdb-test 53 "t" "4" } } */
47 int u = b; /* { dg-final { gdb-test 53 "u" "2" } } */
48 float v = a; /* { dg-final { gdb-test 53 "v" "1" } } */
49 double w = d / 4.0; /* { dg-final { gdb-test 53 "w" "1" } } */
50 double x = a + b - 3 + 1.0e20;/* { dg-final { gdb-test 53 "x" "1e\\+20" } } */
51 double y = b + c * 7.0; /* { dg-final { gdb-test 53 "y" "23" } } */
52 float z = d + e + 3.0f; /* { dg-final { gdb-test 53 "z" "12" } } */
66 __attribute__((noinline, noclone)) void
67 f3 (long long a, int b, long long c, unsigned d)
69 long long w = (a > d) ? a : d;/* { dg-final { gdb-test 73 "w" "4" } } */
70 long long x = a + b + 7; /* { dg-final { gdb-test 73 "x" "10" } } */
71 long long y = c + d + 0x912345678LL;/* { dg-final { gdb-test 73 "y" "38960125567" } } */
72 int z = (x + y); /* { dg-final { gdb-test 73 "z" "305419913" } } */
76 __attribute__((noinline, noclone)) void
77 f4 (_Decimal32 a, _Decimal64 b, _Decimal128 c)
79 _Decimal32 w = a * 8.0DF + 6.0DF;/* { dg-final { xfail-gdb-test 82 "(int)w" "70" } } */
80 _Decimal64 x = b / 8.0DD - 6.0DD;/* { dg-final { xfail-gdb-test 82 "(int)x" "-4" } } */
81 _Decimal128 y = -c / 8.0DL; /* { dg-final { xfail-gdb-test 82 "(int)y" "-8" } } */
88 f1 (1.0, 2.0, 3.0, 4.0f, 5.0f, 6, 7, 8, 9);
89 f2 (1.0, 2.0, 3.0, 4.0f, 5.0f, 6, 7, 8, 9);
91 f4 (8.0DF, 16.0DD, 64.0DL);