enum-codegen.cpp 790 B

123456789101112131415161718192021222324252627282930313233343536
  1. // RUN: rm -rf %t
  2. // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t %s -emit-llvm -o - | FileCheck %s
  3. // CHECK: @_Z3varIiE = {{.*}} %union.union_type { i8 1 },
  4. #pragma clang module build bar
  5. module bar {
  6. header "bar.h" { size 40 mtime 0 }
  7. export *
  8. }
  9. #pragma clang module contents
  10. #pragma clang module begin bar
  11. union union_type {
  12. char h{1};
  13. };
  14. #pragma clang module end
  15. #pragma clang module endbuild
  16. #pragma clang module build foo
  17. module foo {
  18. header "foo.h" { size 97 mtime 0 }
  19. export *
  20. }
  21. #pragma clang module contents
  22. #pragma clang module begin foo
  23. union union_type {
  24. char h{1};
  25. };
  26. #pragma clang module import bar
  27. template<typename T>
  28. union_type var;
  29. #pragma clang module end
  30. #pragma clang module endbuild
  31. #pragma clang module import foo
  32. int main() {
  33. (void)&var<int>;
  34. }