<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/106142>106142</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [compiler-rt] Test using 'export' failing to execute with lit internal shell due to too many arguments
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          connieyzhu
      </td>
    </tr>
</table>

<pre>
    The following RUN line in `compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c` fails when run with lit's internal shell because `export` is given two arguments instead of only one. 
`RUN: export %env_asan_opts=print_scariness=1`

`%env_asan_opts` expands to `env ASAN_OPTIONS`, which is why the test is failing to execute. 

This is the error message given when running compiler-rt tests with `LIT_USE_INTERNAL_SHELL=1`.

```
FAIL: AddressSanitizer-x86_64-linux-dynamic :: TestCases/Posix/high-address-dereference.c (1 of 2)
******************** TEST 'AddressSanitizer-x86_64-linux-dynamic :: TestCases/Posix/high-address-dereference.c' FAILED ********************
Exit Code: 127

Command Output (stdout):
--
# RUN: at line 7
/usr/local/google/home/connieyzhu/llvm-fork/build/./bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only   -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   -shared-libasan /usr/local/google/home/connieyzhu/llvm-fork/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c -o /usr/local/google/home/connieyzhu/llvm-fork/build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Posix/Output/high-address-dereference.c.tmp
# executed command: /usr/local/google/home/connieyzhu/llvm-fork/build/./bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -shared-libasan /usr/local/google/home/connieyzhu/llvm-fork/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c -o /usr/local/google/home/connieyzhu/llvm-fork/build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Posix/Output/high-address-dereference.c.tmp
# RUN: at line 8
export env ASAN_OPTIONS=print_scariness=1
# executed command: export env ASAN_OPTIONS=print_scariness=1
# .---command stderr------------
# | 'export' supports only one argument
# `-----------------------------
# error: command failed with exit status: 127
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVt-P4jYQ_mvMy8goGEjYBx4oP9SVEHc6OLVvyEkmiXuOjWxngfvrqwlh4XavV3W3laqqKCJxPDOZ-fyN_UnvVWkQp2z8ExsverIJlXXTzBqj8Py1anqpzc_TXYVQWK3tUZkSPn3egFYGQRlgcZTZ-qA0Ou4CE6uAnm7SS8PEaoc-zKVHz8Tqo_XqxMSqUmXFZZ479J7n6LBAhybDfsbiCAqptIdjhQZcY-CoQgVaBSYSD8oEdEZq8BVqDSlmsvFIOeDpYF0gf-WhVE9oIBwtSFc2NZpArj6gzMEWYI0-gzXYBxYtWDRjcfTp84YNZ3CJAkyM0TztqYS9PQTPhouDUybsfSadMujpzYDFUed_jfLKL44opDS5h2DbNM0TzLazzf7Dx93jh822dZrDsVJZRZkfqzOECoFApDGBQYgHC3jCrAm3pNv_XaU82ZEPOmcd1Oi9LLHD4AqjoSB369R-wF_AZXG0ftztP2-X-8fNbvlpM1vvtz8v1-uuyP7LKi9XO1zNHtcE3OyymltpVFBf0fHTJN7HI66VaU48PxtZqwzYcEbGf40TwMRkQMsmmHjokhBvv2C33O6AieQfTJmJBAiZ5QLek-ql2OVJBZjbHCmPgUjuV2Nu61qaHD404dAQbyc-5LYJhNSws-H8CtoQOprLcGnfayyxarxjYqVtJjUTq9LaUiOVaGu63XYDMtJPNS-s-8LEKm2UzplY9elZUb9nWpoSeOE7WNlw0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