Skip to content

Commit

Permalink
basic: Add volatile to prevent optimizations
Browse files Browse the repository at this point in the history
Prevent the compiler from optimizing away initialization loops
  • Loading branch information
lakshmih committed Apr 7, 2024
1 parent 5fe1cc0 commit 2401a40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_conformance/basic/test_vector_swizzle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ static void makeReference(std::vector<T>& ref)
ref.resize(refSize);
std::fill(ref.begin(), ref.end(), 99);

size_t dstIndex = 0;
volatile size_t dstIndex = 0;

// single channel lvalue
for (size_t i = 0; i < N; i++)
Expand Down

0 comments on commit 2401a40

Please sign in to comment.