File tree 1 file changed +29
-0
lines changed
tests/success/sizeof_value
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ pragma => adept("3.0")
3
+
4
+ #[foreign]
5
+ func printf(format ptr#char, ...) int
6
+
7
+ struct FullName (firstname ptr#char, lastname ptr#char)
8
+
9
+ func main {
10
+ c := c'A'
11
+ sh := 123.short()
12
+ i_3_2 := 0
13
+
14
+ fullname := FullName {
15
+ firstname: c"Isaac",
16
+ lastname: c"Shelton",
17
+ }
18
+
19
+ printf(c"sizeof#(c) = %d\n", sizeof#(c).int())
20
+ printf(c"sizeof#(sh) = %d\n", sizeof#(sh).int())
21
+ printf(c"sizeof#(i_3_2) = %d\n", sizeof#(i_3_2).int())
22
+ printf(c"sizeof#(fullname) = %d\n", sizeof#(fullname).int())
23
+
24
+ // This syntax is also accepted
25
+ printf(c"sizeof<(fullname)> = %d\n", sizeof<(fullname)>.int())
26
+ printf(c"sizeof<(fullname.firstname)> = %d\n", sizeof<(fullname.firstname)>.int())
27
+ printf(c"sizeof#(fullname.firstname.ptr()) = %d\n", sizeof#(fullname.firstname.ptr()).int())
28
+ }
29
+
You can’t perform that action at this time.
0 commit comments