diff options
author | Michael Forney <mforney@mforney.org> | 2019-05-16 00:02:11 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-05-16 00:33:57 -0700 |
commit | 99d9848603d07114a79093f5fe71d6cf08a606aa (patch) | |
tree | bc02750262374db710693e55bcba6ace990a15a0 /test | |
parent | 73e7c145e0c5d983cec3be18240851324b818d9f (diff) | |
download | cproc-99d9848603d07114a79093f5fe71d6cf08a606aa.tar.xz |
decl: Qualifiers of array type are for element type
Diffstat (limited to 'test')
-rw-r--r-- | test/const-array.c | 5 | ||||
-rw-r--r-- | test/const-array.qbe | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/const-array.c b/test/const-array.c new file mode 100644 index 0000000..c2bfe46 --- /dev/null +++ b/test/const-array.c @@ -0,0 +1,5 @@ +/* C11 6.7.3p9 - type qualifiers on array type qualify the element type */ +typedef int T[2]; +void f(const T x) { + x = 0; +} diff --git a/test/const-array.qbe b/test/const-array.qbe new file mode 100644 index 0000000..8648976 --- /dev/null +++ b/test/const-array.qbe @@ -0,0 +1,10 @@ +export +function $f(l %.1) { +@start.1 + %.2 =l alloc8 8 + storel %.1, %.2 +@body.2 + %.3 =l extsw 0 + storel %.3, %.2 + ret +} |