mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Post and pre-decrement operators switched places for vector elements. #2010.
This commit is contained in:
20
test/test_suite/vector/vector_inc.c3t
Normal file
20
test/test_suite/vector/vector_inc.c3t
Normal file
@@ -0,0 +1,20 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
fn void main()
|
||||
{
|
||||
float[<1>] myvar = { 3 };
|
||||
myvar.x = ++myvar.x * 2;
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
%0 = load <1 x float>, ptr %myvar, align 4
|
||||
%1 = load <1 x float>, ptr %myvar, align 4
|
||||
%2 = extractelement <1 x float> %1, i64 0
|
||||
%fincdec = fadd float %2, 1.000000e+00
|
||||
%3 = insertelement <1 x float> %1, float %fincdec, i64 0
|
||||
store <1 x float> %3, ptr %myvar, align 4
|
||||
%fmul = fmul float %fincdec, 2.000000e+00
|
||||
%elemset = insertelement <1 x float> %0, float %fmul, i64 0
|
||||
store <1 x float> %elemset, ptr %myvar, align 4
|
||||
ret void
|
||||
Reference in New Issue
Block a user