hello.c 455 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. double
  6. foo(double d)
  7. {
  8. return d / 3.0;
  9. }
  10. double
  11. maybe_min(double d, double e)
  12. {
  13. return d < e ? d : e;
  14. }
  15. double
  16. factor(double a, double b, double c)
  17. {
  18. return (a * c) + (b * c);
  19. }
  20. int
  21. echo(int a)
  22. {
  23. double b = foo(14.5);
  24. double c = maybe_min(12.2, 15.4);
  25. double d = factor(a, b, c);
  26. return 2 * a;
  27. }