examples/tests

Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-08-23 13:50:26 +02:00
padre 953c3ad48d
commit 36bee15ae6
Se han modificado 89 ficheros con 1286 adiciones y 0 borrados

Ver fichero

@@ -0,0 +1,34 @@
/*
* ALECC Pointer Support Test Suite
* This file demonstrates all implemented pointer features
*/
#include <stdio.h>
int main() {
// Test 1: Basic pointer declaration and assignment
int x = 42;
int *ptr = &x; // Address-of operator
// Test 2: Reading through pointer dereference
int value = *ptr; // Dereference for reading
// Test 3: Writing through pointer dereference
*ptr = 100; // Dereference for assignment
// Test 4: Multiple pointers
int y = 200;
int *ptr2 = &y;
// Test 5: Pointer reassignment
ptr = ptr2; // Point to different variable
// Test 6: Complex expressions with dereferences
int result = *ptr + *ptr2; // Both pointers pointing to same location
// Test 7: Null pointer
int *null_ptr = 0;
printf("All pointer tests compiled successfully!\n");
return 0;
}