summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-990525-2.c
blob: 2b2411e4589ff27fa468a377d0a553a474cd01b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
   990525-2.c from the execute part of the gcc torture suite.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

// TODO: Enable when sdcc can return struct!
#if 0
typedef struct {
    int v[4];
} Test1;

Test1 func2();

int func1()
{
    Test1 test;
    test = func2();

    if (test.v[0] != 10)
      ASSERT (0);
    if (test.v[1] != 20)
      ASSERT (0);
    if (test.v[2] != 30)
      ASSERT (0);
    if (test.v[3] != 40)
      ASSERT (0);
}

Test1 func2()
{
    Test1 tmp;
    tmp.v[0] = 10;
    tmp.v[1] = 20;
    tmp.v[2] = 30;
    tmp.v[3] = 40;
    return tmp;
}
#endif

void
testTortureExecute (void)
{
#if 0
    func1();
    return;
#endif
}