mC.c 687 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. __attribute__((import_module("mA")))
  4. __attribute__((import_name("A1"))) extern int
  5. A1();
  6. __attribute__((import_module("mB")))
  7. __attribute__((import_name("B1"))) extern int
  8. B1();
  9. __attribute__((import_module("mB")))
  10. __attribute__((import_name("B2"))) extern int
  11. B2();
  12. __attribute__((export_name("C1"))) int
  13. C1()
  14. {
  15. return 31;
  16. }
  17. __attribute__((export_name("C2"))) int
  18. C2()
  19. {
  20. return B1();
  21. }
  22. __attribute__((export_name("C3"))) int
  23. C3()
  24. {
  25. return A1();
  26. }
  27. __attribute__((export_name("C4"))) int
  28. C4()
  29. {
  30. return B2();
  31. }
  32. int
  33. C5()
  34. {
  35. return C1() + C2() + C3() + 35;
  36. }
  37. int
  38. main()
  39. {
  40. printf("%u\n", C5());
  41. return EXIT_SUCCESS;
  42. }