2 /* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> 2002-05-27. */
4 /* Use a different function for each test so the link failures
5 indicate which one is broken. */
6 extern void link_error0 (void);
7 extern void link_error1 (void);
8 extern void link_error2 (void);
9 extern void link_error3 (void);
10 extern void link_error4 (void);
11 extern void link_error5 (void);
12 extern void link_error6 (void);
13 extern void link_error7 (void);
17 extern int func0 (int) __attribute__ ((__pure__));
18 extern int func1 (int) __attribute__ ((__const__));
20 /* GCC should automatically detect attributes for these functions.
21 At -O3 They'll be inlined, but that's ok. */
22 static int func2 (int a) { return i + a; } /* pure */
23 static int func3 (int a) { return a * 3; } /* const */
24 static int func4 (int a) { return func0(a) + a; } /* pure */
25 static int func5 (int a) { return a + func1(a); } /* const */
26 static int func6 (int a) { return func2(a) + a; } /* pure */
27 static int func7 (int a) { return a + func3(a); } /* const */
76 int func0 (int a) { return a - i; } /* pure */
77 int func1 (int a) { return a - a; } /* const */
82 /* Avoid link failures when not optimizing. */
91 #endif /* ! __OPTIMIZE__ */