OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [950607-2.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
typedef struct {
2
  long int p_x, p_y;
3
} Point;
4
 
5
int
6
f (Point basePt, Point pt1, Point pt2)
7
{
8
  long long vector;
9
 
10
  vector =
11
    (long long) (pt1.p_x - basePt.p_x) * (long long) (pt2.p_y - basePt.p_y) -
12
      (long long) (pt1.p_y - basePt.p_y) * (long long) (pt2.p_x - basePt.p_x);
13
 
14
  if (vector > (long long) 0)
15
    return 0;
16
  else if (vector < (long long) 0)
17
    return 1;
18
  else
19
    return 2;
20
}
21
 
22
main ()
23
{
24
  Point b, p1, p2;
25
  int answer;
26
 
27
  b.p_x = -23250;
28
  b.p_y = 23250;
29
 
30
  p1.p_x = 23250;
31
  p1.p_y = -23250;
32
 
33
  p2.p_x = -23250;
34
  p2.p_y = -23250;
35
 
36
  answer = f (b, p1, p2);
37
 
38
  if (answer != 1)
39
    abort ();
40
  exit (0);
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.