diff options
| author | Evan Haas <evan@lagerdata.com> | 2024-07-29 10:12:33 -0700 |
|---|---|---|
| committer | Evan Haas <evan@lagerdata.com> | 2024-07-29 10:25:55 -0700 |
| commit | 5d8e56c2ebf22cc1320aa26d8ed6877bd03036cb (patch) | |
| tree | 04d85873cf6a94718cdc29a97d7bb0ab1d598335 /test | |
| parent | d7b9bbecaf6ba3ee924d7744ea720c67bc8f0a1b (diff) | |
| download | zig-5d8e56c2ebf22cc1320aa26d8ed6877bd03036cb.tar.gz zig-5d8e56c2ebf22cc1320aa26d8ed6877bd03036cb.zip | |
aro_translate_c: do not translate _Static_assert declarations
This does not completely ignore static asserts - they are validated by aro
during parsing; any failures will render an error and non-zero exit code.
Emit a warning comment that _Static_asserts are not translated - this
matches the behavior of the existing clang-based translate-c.
Aro currently does not store source locations for _Static_assert
declarations so I've hard-coded token index 0 for now.
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases/translate_c/_Static_assert.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cases/translate_c/_Static_assert.c b/test/cases/translate_c/_Static_assert.c new file mode 100644 index 0000000000..8ecc639e9d --- /dev/null +++ b/test/cases/translate_c/_Static_assert.c @@ -0,0 +1,7 @@ +_Static_assert(1 == 1, ""); + +// translate-c +// target=x86_64-linux +// c_frontend=aro +// +// tmp.c:1:1: warning: ignoring _Static_assert declaration |
