Revert "Fix #21024 - Optimize x^^c expressions (#21082)" (#21114)

This reverts commit fa1f860e4b.
This commit is contained in:
Dennis 2025-03-29 12:25:53 +01:00 committed by GitHub
parent fa1f860e4b
commit 8dcef66a5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 0 additions and 151 deletions

View file

@ -1,44 +0,0 @@
/*
REQUIRED_ARGS: -betterC
RUN_OUTPUT:
---
Success
---
*/
import core.stdc.stdio;
void test1()
{
enum real Two = 2.0;
static assert(Two^^3 == 8.0);
}
void test2()
{
double x = 5.0;
assert(x^^-1 == 1/x);
x = -1.0;
assert(x^^1 == x);
assert((x += 3) ^^ 2.0 == 4.0);
assert((x) ^^ 2.0 == 4.0);
assert((x *= 5) ^^ 2.0 == (x * x));
assert(x^^-1 == 1.0 / x);
assert((x^^-1) ^^ 0.0 == 1.0);
}
void test3()
{
int x = 6;
assert(x ^^ 0 == 1);
assert((x += 3) ^^ 2 == 81);
assert(x ^^ 2 == (x ^^ 1) * (x ^^ 1));
static assert(4.0 ^^ -1 == 0.25);
}
extern(C) void main()
{
test1();
test2();
test3();
printf("Success\n");
}