summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulius Ikkala <julius.ikkala@gmail.com>2025-05-10 01:50:14 +0300
committerGitHub <noreply@github.com>2025-05-09 18:50:14 -0400
commit029672ee08f5ecb710e84cf1ccc625e826ff9a29 (patch)
treee5d9c263c2e26455bc3daa652173a6c1ab21ebf2 /tests
parentdbf05f8dca79d7bb166038652d968554d486c9fd (diff)
Fix various intptr_t issues by defining its width in `getIntTypeInfo` (#6786)
* Define a bit size for the intptr types * Fix intptr_t sign * Extend intptr test to check for previously broken operations * Fix intptr vector test on CUDA * Handle intptr size in getAnyValueSize * Fix formatting * Try with __ARM_ARCH_ISA_64 * On macs, int64_t != intptr_t Yikes * Move define to prelude header * Also check apple in host-prelude * Fix define location
Diffstat (limited to 'tests')
-rw-r--r--tests/language-feature/types/intptr.slang7
-rw-r--r--tests/language-feature/types/intptr.slang.expected.txt4
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/language-feature/types/intptr.slang b/tests/language-feature/types/intptr.slang
index 0be67cdb7..491fc6c38 100644
--- a/tests/language-feature/types/intptr.slang
+++ b/tests/language-feature/types/intptr.slang
@@ -29,11 +29,16 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
{
testResult = 0;
}
- uintptr_t b = 0uz;
+ uintptr_t b = 50uz;
actualSize = getSizeOf(b);
if (expectedSize != actualSize)
{
testResult = 0;
}
outputBuffer[dispatchThreadID.x] = testResult;
+ outputBuffer[dispatchThreadID.x+1] = int(b >> 1);
+
+ vector<uintptr_t, 2> c = vector<uintptr_t, 2>(2uz);
+ vector<uintptr_t, 2> d = vector<uintptr_t, 2>(3uz);
+ outputBuffer[dispatchThreadID.x+2] = int((c+d).y);
}
diff --git a/tests/language-feature/types/intptr.slang.expected.txt b/tests/language-feature/types/intptr.slang.expected.txt
index 56a6051ca..c78bed2b0 100644
--- a/tests/language-feature/types/intptr.slang.expected.txt
+++ b/tests/language-feature/types/intptr.slang.expected.txt
@@ -1 +1,3 @@
-1 \ No newline at end of file
+1
+19
+5