Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 45a92af

Browse files
authored
Add exponentiation test for runtime (#899)
1 parent e25fa0f commit 45a92af

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Qir/Tests/QIR-static/qir-test-math.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ extern "C" uint64_t Microsoft__Quantum__Testing__QIR__Math__SinhTest__Interop();
2323
extern "C" uint64_t Microsoft__Quantum__Testing__QIR__Math__CoshTest__Interop(); // NOLINT
2424
extern "C" uint64_t Microsoft__Quantum__Testing__QIR__Math__TanhTest__Interop(); // NOLINT
2525
extern "C" uint64_t Microsoft__Quantum__Testing__QIR__Math__IeeeRemainderTest__Interop(); // NOLINT
26+
extern "C" uint64_t Microsoft__Quantum__Testing__QIR__Math__ExponentTest__Interop(); // NOLINT
2627
extern "C" int64_t Microsoft__Quantum__Testing__QIR__Math__TestDrawRandomInt__Interop( // NOLINT
2728
int64_t min, int64_t max);
2829
extern "C" double Microsoft__Quantum__Testing__QIR__Math__TestDrawRandomDouble__Interop( // NOLINT
@@ -98,6 +99,11 @@ TEST_CASE("QIR: Math.IeeeRemainder", "[qir.math][qir.Math.IeeeRemainder]")
9899
REQUIRE(0 == Microsoft__Quantum__Testing__QIR__Math__IeeeRemainderTest__Interop());
99100
}
100101

102+
TEST_CASE("QIR: Math.Exponent.builtin", "[qir.math][qir.Math.Exponent.builtin]")
103+
{
104+
REQUIRE(0 == Microsoft__Quantum__Testing__QIR__Math__ExponentTest__Interop());
105+
}
106+
101107
TEST_CASE("QIR: Math.DrawRandomInt", "[qir.math][qir.Math.DrawRandomInt]")
102108
{
103109
// Test that the Q# random number generator is a wrapper around the C++ generator:

src/Qir/Tests/QIR-static/qsharp/qir-test-math.qs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,4 +346,9 @@ namespace Microsoft.Quantum.Testing.QIR.Math {
346346
return 0;
347347
}
348348

349+
@EntryPoint()
350+
function ExponentTest() : Int {
351+
return (2 ^ 2) - 4;
352+
}
353+
349354
}

0 commit comments

Comments
 (0)