diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-17 22:16:19 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-17 22:16:19 +0000 |
commit | b7d0844c887a72064b624dc6df12cbe1441f69d0 (patch) | |
tree | e8b79d5d3d7d5c681818155cc53122a3a90a1f10 /test/CodeGen/alignof.c | |
parent | 39aa1ed8f9b8d85947a2ef9febe50511362d8ed1 (diff) |
Eek! getDeclAlign sometimes returned alignment in bits.
- Renamed to getDeclAlignInBytes since most other query functions
work in bits.
- Fun to track down as isIntegerConstantExpr was getting it right,
but Evaluate() was getting it wrong. Maybe we should assert they
compute the same thing when they succeed?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/alignof.c')
-rw-r--r-- | test/CodeGen/alignof.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/alignof.c b/test/CodeGen/alignof.c new file mode 100644 index 0000000000..edeb0db771 --- /dev/null +++ b/test/CodeGen/alignof.c @@ -0,0 +1,12 @@ +// RUN: clang -triple i386-unknown-unknown -O1 -emit-llvm -o %t %s && +// RUN: grep 'ret i32 4' %t + +enum e0 { E0 }; +struct s0 { + enum e0 a:31; +}; + +struct s0 t1_tmp; +int f0() { + return __alignof__(t1_tmp); +} |