aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-04 14:53:01 +0900
committernsfisis <nsfisis@gmail.com>2025-05-04 14:53:01 +0900
commit1a224ae3f0e9565e0740288c176967659d856928 (patch)
tree0a06574947a04da88355a74ca3b430791fb011a6 /tests
parentc383c4874262761cf4b1e8aa4eb21e47c0c78bc5 (diff)
downloadP4Dcc-1a224ae3f0e9565e0740288c176967659d856928.tar.gz
P4Dcc-1a224ae3f0e9565e0740288c176967659d856928.tar.zst
P4Dcc-1a224ae3f0e9565e0740288c176967659d856928.zip
sizeof
Diffstat (limited to 'tests')
-rw-r--r--tests/023.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/023.sh b/tests/023.sh
new file mode 100644
index 0000000..86e2aa6
--- /dev/null
+++ b/tests/023.sh
@@ -0,0 +1,39 @@
+set -e
+
+cat <<'EOF' > expected
+sizeof(int) = 4
+sizeof(int*) = 8
+sizeof(char) = 1
+sizeof(char*) = 8
+sizeof(long) = 8
+sizeof(long*) = 8
+sizeof(void*) = 8
+sizeof(int**) = 8
+sizeof(char**) = 8
+sizeof(long**) = 8
+sizeof(void**) = 8
+sizeof(int***) = 8
+sizeof(char***) = 8
+sizeof(long***) = 8
+sizeof(void***) = 8
+EOF
+bash ../../test_diff.sh <<'EOF'
+int main() {
+ printf("sizeof(int) = %d\n", sizeof(int));
+ printf("sizeof(int*) = %d\n", sizeof(int*));
+ printf("sizeof(char) = %d\n", sizeof(char));
+ printf("sizeof(char*) = %d\n", sizeof(char*));
+ printf("sizeof(long) = %d\n", sizeof(long));
+ printf("sizeof(long*) = %d\n", sizeof(long*));
+ printf("sizeof(void*) = %d\n", sizeof(void*));
+ printf("sizeof(int**) = %d\n", sizeof(int**));
+ printf("sizeof(char**) = %d\n", sizeof(char**));
+ printf("sizeof(long**) = %d\n", sizeof(long**));
+ printf("sizeof(void**) = %d\n", sizeof(void**));
+ printf("sizeof(int***) = %d\n", sizeof(int***));
+ printf("sizeof(char***) = %d\n", sizeof(char***));
+ printf("sizeof(long***) = %d\n", sizeof(long***));
+ printf("sizeof(void***) = %d\n", sizeof(void***));
+ return 0;
+}
+EOF