Skip to content

Commit e779672

Browse files
Support _Alignof
1 parent 69f20df commit e779672

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/frontc/clexer.mll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ let init_lexicon _ =
183183
("__typeof", fun loc -> TYPEOF loc);
184184
("typeof", fun loc -> TYPEOF loc);
185185
("__alignof", fun loc -> ALIGNOF loc);
186+
("_Alignof", fun loc -> ALIGNOF loc);
186187
("__alignof__", fun loc -> ALIGNOF loc);
187188
("__volatile__", fun loc -> VOLATILE loc);
188189
("__volatile", fun loc -> VOLATILE loc);

test/small1/c11-align-of.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "testharness.h"
2+
#include <stdnoreturn.h>
3+
4+
5+
int main() {
6+
int x = _Alignof (int);
7+
SUCCESS;
8+
}

test/testcil.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ sub addToGroup {
699699
addTest("testrunc11/c11-noreturn");
700700
addTest("testrunc11/c11-atomic");
701701
addTest("testrunc11/c11-static-assert");
702+
addTest("testrunc11/c11-static-align-of");
702703
addTest("testrunc11/gcc-c11-generic-1");
703704
# TODO: these messages are not even checked?
704705
addTestFail("testc11/gcc-c11-generic-2-1", "Multiple defaults in generic");

0 commit comments

Comments
 (0)