diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-03-07 10:34:53 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-03-09 22:16:50 +0100 |
| commit | 0603c7e28e8063dd8e56a7f89b7222971b9d4f34 (patch) | |
| tree | 1f97d0c4aefa2ea80485ffb49b609dd834c37959 /validation/mem2reg/packed-bitfield.c | |
| parent | 5e674421d5f144612a8d39cafae557bbfa7026fa (diff) | |
| download | sparse-dev-0603c7e28e8063dd8e56a7f89b7222971b9d4f34.tar.gz | |
ssa: add some testcases for mismatched memops
The SSA conversion is incorrect when the size or offset of the
memory operations doesn't match. It shouldn't be done at all.
So, add a few testcases for this.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/mem2reg/packed-bitfield.c')
| -rw-r--r-- | validation/mem2reg/packed-bitfield.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/validation/mem2reg/packed-bitfield.c b/validation/mem2reg/packed-bitfield.c new file mode 100644 index 00000000..4eaf0bef --- /dev/null +++ b/validation/mem2reg/packed-bitfield.c @@ -0,0 +1,36 @@ +struct s { + int:16; + int f:16; +} __attribute__((__packed__)); + +static void foo(struct s s) +{ + while (s.f) + ; +} + +/* + * check-name: packed-bitfield + * check-command: test-linearize -fmem2reg $file + * check-known-to-fail + * + * check-output-contains: store.32 + * check-output-contains: load.16 + * + * check-output-start +foo: +.L0: + <entry-point> + store.32 %arg1 -> 0[s] + br .L4 + +.L4: + load.16 %r1 <- 2[s] + cbr %r1, .L4, .L3 + +.L3: + ret + + + * check-output-end + */ |
