| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: varmod-order-numeric.mk,v 1.7 2022/02/09 21:09:24 rillig Exp $ | | 1 | # $NetBSD: varmod-order-numeric.mk,v 1.8 2022/09/27 19:18:45 rillig Exp $ |
2 | # | | 2 | # |
3 | # Tests for the variable modifiers ':On', which returns the words, sorted in | | 3 | # Tests for the variable modifiers ':On', which returns the words, sorted in |
4 | # ascending numeric order, and for ':Orn' and ':Onr', which additionally | | 4 | # ascending numeric order, and for ':Orn' and ':Onr', which additionally |
5 | # reverse the order. | | 5 | # reverse the order. |
6 | # | | 6 | # |
7 | # The variable modifiers ':On', ':Onr' and ':Orn' were added in var.c 1.939 | | 7 | # The variable modifiers ':On', ':Onr' and ':Orn' were added in var.c 1.939 |
8 | # from 2021-07-30. | | 8 | # from 2021-07-30. |
9 | | | 9 | |
10 | # This list contains only 32-bit numbers since the make code needs to conform | | 10 | # This list contains only 32-bit numbers since the make code needs to conform |
11 | # to C90, which does not necessarily provide integer types larger than 32 bit. | | 11 | # to C90, which does not necessarily provide integer types larger than 32 bit. |
12 | # Make uses 'long long' for C99 or later, and 'long' for older C versions. | | 12 | # Make uses 'long long' for C99 or later, and 'long' for older C versions. |
13 | # | | 13 | # |
14 | # To get 53-bit integers even in C90, it would be possible to switch to | | 14 | # To get 53-bit integers even in C90, it would be possible to switch to |
| @@ -40,14 +40,20 @@ DUPLICATES= 3 1 2 2 1 1 # subsequence of | | | @@ -40,14 +40,20 @@ DUPLICATES= 3 1 2 2 1 1 # subsequence of |
40 | # If there are several numbers that have the same integer value, they are | | 40 | # If there are several numbers that have the same integer value, they are |
41 | # returned in unspecified order. | | 41 | # returned in unspecified order. |
42 | SAME_VALUE:= ${:U 79 80 0x0050 81 :On} | | 42 | SAME_VALUE:= ${:U 79 80 0x0050 81 :On} |
43 | .if ${SAME_VALUE} != "79 80 0x0050 81" && ${SAME_VALUE} != "79 0x0050 80 81" | | 43 | .if ${SAME_VALUE} != "79 80 0x0050 81" && ${SAME_VALUE} != "79 0x0050 80 81" |
44 | . error ${SAME_VALUE} | | 44 | . error ${SAME_VALUE} |
45 | .endif | | 45 | .endif |
46 | | | 46 | |
47 | # Hexadecimal and octal numbers can be sorted as well. | | 47 | # Hexadecimal and octal numbers can be sorted as well. |
48 | MIXED_BASE= 0 010 0x7 9 | | 48 | MIXED_BASE= 0 010 0x7 9 |
49 | .if ${MIXED_BASE:On} != "0 0x7 010 9" | | 49 | .if ${MIXED_BASE:On} != "0 0x7 010 9" |
50 | . error ${MIXED_BASE:On} | | 50 | . error ${MIXED_BASE:On} |
51 | .endif | | 51 | .endif |
52 | | | 52 | |
| | | 53 | # The measurement units for suffixes are k, M, G, but not T. |
| | | 54 | # The string '3T' evaluates to 3, the string 'x' evaluates as '0'. |
| | | 55 | .if ${4 3T 2M x:L:On} != "x 3T 4 2M" |
| | | 56 | . error |
| | | 57 | .endif |
| | | 58 | |
53 | all: | | 59 | all: |