clang: tms34010 data model and packed structs
This commit is contained in:
1 parent
16c4189f16
commit
e0c2ee77e5
1 file changed
+33
@@ -166,6 +166,39 @@ index 000000000..31349d09a
|
||||
+} // namespace clang
|
||||
+
|
||||
+#endif
|
||||
diff --git a/clang/test/CodeGen/TMS34010/layout.c b/clang/test/CodeGen/TMS34010/layout.c
|
||||
new file mode 100644
|
||||
index 000000000..3dbf7f3e6
|
||||
--- /dev/null
|
||||
+++ b/clang/test/CodeGen/TMS34010/layout.c
|
||||
@@ -0,0 +1,27 @@
|
||||
+// RUN: %clang_cc1 -triple tms34010-unknown-none -ffreestanding -fsyntax-only %s
|
||||
+struct S { char c; int i; void *p; };
|
||||
+enum E { E0 = 0, E1 = 1 };
|
||||
+
|
||||
+_Static_assert(sizeof(struct S) == 9, "packed struct");
|
||||
+_Static_assert(__builtin_offsetof(struct S, i) == 1, "packed i");
|
||||
+_Static_assert(__builtin_offsetof(struct S, p) == 5, "packed p");
|
||||
+_Static_assert(_Alignof(struct S) == 1, "packed struct alignment");
|
||||
+_Static_assert(_Alignof(int) == 2, "object alignment");
|
||||
+_Static_assert(sizeof(int) == 4, "int");
|
||||
+_Static_assert(sizeof(long) == 4, "long");
|
||||
+_Static_assert(sizeof(void *) == 4, "pointer");
|
||||
+_Static_assert(sizeof(short) == 2, "short");
|
||||
+_Static_assert(sizeof(long double) == 8, "long double");
|
||||
+_Static_assert(sizeof(float) == 4, "float");
|
||||
+_Static_assert(sizeof(double) == 8, "double");
|
||||
+_Static_assert(sizeof(long long) == 8, "long long");
|
||||
+_Static_assert(sizeof(_Bool) == 1, "_Bool");
|
||||
+_Static_assert(sizeof(__WCHAR_TYPE__) == 4, "wchar_t");
|
||||
+_Static_assert(sizeof(__SIZE_TYPE__) == 4, "size_t");
|
||||
+_Static_assert(sizeof(__PTRDIFF_TYPE__) == 4, "ptrdiff_t");
|
||||
+_Static_assert((char)-1 < 0, "char is signed");
|
||||
+_Static_assert(_Alignof(char) == 1, "char align");
|
||||
+_Static_assert(_Alignof(short) == 2, "short align");
|
||||
+_Static_assert(_Alignof(void *) == 2, "pointer align");
|
||||
+_Static_assert(_Alignof(double) == 2, "double align");
|
||||
+_Static_assert(sizeof(enum E) == 4, "enum");
|
||||
diff --git a/clang/test/CodeGen/TMS34010/triple.c b/clang/test/CodeGen/TMS34010/triple.c
|
||||
new file mode 100644
|
||||
index 000000000..23e587996
|
||||
|
||||
Reference in new issue
Block a user