Skip to content

Commit

Permalink
Add lit tests for #2860
Browse files Browse the repository at this point in the history
  • Loading branch information
aneshlya committed Dec 23, 2024
1 parent a79fd75 commit 1f0a5c1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/lit-tests/2860.ispc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Check that the code below can be compiled successfully.
// RUN: %{ispc} --target=host --nowrap -o %t.o %s
// CHECK-NOT: Error:
template <typename TVec, typename T> TVec FastDiv(T Lhs, TVec Rhs) {
TVec Result = {Lhs * rcp((T)Rhs.X), Lhs * rcp((T)Rhs.Y)};
return Result;
}

struct FVec {
float X;
float Y;
};

void foo(float Lhs, FVec Rhs) { FastDiv<FVec, float>(Lhs, Rhs); }

0 comments on commit 1f0a5c1

Please sign in to comment.