// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

shader
test ()
{
    // int
    {
        printf ("int:\n");
        int a = 0;
        int b;
        printf ("  a = %d\n", a);
        b = ++a;
        printf ("  after b = ++a, a = %d, b = %d\n", a, b);
        b = --a;
        printf ("  after b = --a, a = %d, b = %d\n", a, b);
        b = a++;
        printf ("  after b = a++, a = %d, b = %d\n", a, b);
        b = a--;
        printf ("  after b = a--, a = %d, b = %d\n", a, b);
    }


    // float
    {
        printf ("float:\n");
        float a = 0;
        float b;
        printf ("  a = %g\n", a);
        b = ++a;
        printf ("  after b = ++a, a = %g, b = %g\n", a, b);
        b = --a;
        printf ("  after b = --a, a = %g, b = %g\n", a, b);
        b = a++;
        printf ("  after b = a++, a = %g, b = %g\n", a, b);
        b = a--;
        printf ("  after b = a--, a = %g, b = %g\n", a, b);
    }

}
