[llvm-commits] CVS: llvm/test/Regression/CFrontend/bit-accurate-int.c
Reid Spencer
reid at x10sys.com
Tue Jan 16 10:40:23 PST 2007
Changes in directory llvm/test/Regression/CFrontend:
bit-accurate-int.c added (r1.1)
---
Log message:
Add a test case for bit accurate integer types in llvm-gcc. This is
XFAILed for now until llvm-gcc changes are committed.
---
Diffs of the changes: (+35 -0)
bit-accurate-int.c | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+)
Index: llvm/test/Regression/CFrontend/bit-accurate-int.c
diff -c /dev/null llvm/test/Regression/CFrontend/bit-accurate-int.c:1.1
*** /dev/null Tue Jan 16 12:40:18 2007
--- llvm/test/Regression/CFrontend/bit-accurate-int.c Tue Jan 16 12:40:08 2007
***************
*** 0 ****
--- 1,35 ----
+ // RUN: %llvmgcc -S %s -o - /dev/null
+ // XFAIL: *
+
+ #define ATTR_BITS(N) __attribute__((bitwidth(N)))
+
+ typedef int ATTR_BITS( 4) My04BitInt;
+ typedef int ATTR_BITS(16) My16BitInt;
+ typedef int ATTR_BITS(17) My17BitInt;
+ typedef int ATTR_BITS(37) My37BitInt;
+ typedef int ATTR_BITS(65) My65BitInt;
+
+ struct MyStruct {
+ My04BitInt i4Field;
+ short ATTR_BITS(12) i12Field;
+ long ATTR_BITS(17) i17Field;
+ My37BitInt i37Field;
+ };
+
+ My37BitInt doit( short ATTR_BITS(23) num) {
+ My17BitInt i;
+ struct MyStruct strct;
+ int bitsize1 = sizeof(My17BitInt);
+ int __attribute__((bitwidth(9))) j;
+ int bitsize2 = sizeof(j);
+ int result = bitsize1 + bitsize2;
+ strct.i17Field = result;
+ result += sizeof(struct MyStruct);
+ return result;
+ }
+
+ int
+ main ( int argc, char** argv)
+ {
+ return (int ATTR_BITS(32)) doit((short ATTR_BITS(23))argc);
+ }
More information about the llvm-commits
mailing list