xref: /aosp_15_r20/external/one-true-awk/bugs-fixed/subsep-overflow.awk (revision 9a7741de182b2776d7b30d6355f2585c0780a51b)
1*9a7741deSElliott Hughesfunction foo(c, n) {
2*9a7741deSElliott Hughes    s = "";
3*9a7741deSElliott Hughes    for (i = 0; i < n; i++) {
4*9a7741deSElliott Hughes        s = s c;
5*9a7741deSElliott Hughes    }
6*9a7741deSElliott Hughes    return s;
7*9a7741deSElliott Hughes}
8*9a7741deSElliott Hughes
9*9a7741deSElliott HughesBEGIN {
10*9a7741deSElliott Hughes    str1 = foo("a", 4500);
11*9a7741deSElliott Hughes    str2 = foo("b", 9000);
12*9a7741deSElliott Hughes
13*9a7741deSElliott Hughes    a[(SUBSEP = str1), (SUBSEP = str2), "c"] = 1;
14*9a7741deSElliott Hughes
15*9a7741deSElliott Hughes    for (k in a) {
16*9a7741deSElliott Hughes        print length(k);
17*9a7741deSElliott Hughes    }
18*9a7741deSElliott Hughes
19*9a7741deSElliott Hughes    print (((SUBSEP = str1), (SUBSEP = str2), "c") in a);
20*9a7741deSElliott Hughes    print (((SUBSEP = str1) SUBSEP (SUBSEP = str2) SUBSEP "c") in a);
21*9a7741deSElliott Hughes    delete a[(SUBSEP = str1), (SUBSEP = str2), "c"];
22*9a7741deSElliott Hughes    print (((SUBSEP = str1), (SUBSEP = str2), "c") in a);
23*9a7741deSElliott Hughes    print (((SUBSEP = str1) SUBSEP (SUBSEP = str2) SUBSEP "c") in a);
24*9a7741deSElliott Hughes}
25