<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - UTF8 data printed differently before and after program start"
   href="https://bugs.llvm.org/show_bug.cgi?id=45856">45856</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>UTF8 data printed differently before and after program start
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pro.mathias.lang@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>test.cpp:
```
extern const char8_t data[12] = u8"Hello World";
int main () { return 0; }
```

Compiled with `clang++ -g -std=c++2a test.cpp`.
Running it under LLDB:
```
(lldb) target create "./a.out"
Current executable set to
'/Users/geod24/projects/dlang/llvm-project/lldb/a.out' (x86_64).
(lldb) p data
(const char8_t [12]) $0 = {
  [0] = 0x48 u8'H'
  [1] = 0x65 u8'e'
  [2] = 0x6c u8'l'
  [3] = 0x6c u8'l'
  [4] = 0x6f u8'o'
  [5] = 0x20 u8' '
  [6] = 0x57 u8'W'
  [7] = 0x6f u8'o'
  [8] = 0x72 u8'r'
  [9] = 0x6c u8'l'
  [10] = 0x64 u8'd'
  [11] = 0x00 u8'\0'
}
(lldb) b main
Breakpoint 1: where = a.out`main + 13 at test.cpp:2:15, address =
0x0000000100000f9d
(lldb) run
Process 54857 launched: '/Users/geod24/projects/dlang/llvm-project/lldb/a.out'
(x86_64)
Process 54857 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f9d a.out`main at test.cpp:2:15
   1    extern const char8_t data[12] = u8"Hello World";
-> 2    int main () { return 0; }
Target 0: (a.out) stopped.
(lldb) p data
(const char8_t [12]) $1 = u8"Hello World"
```

I would expect the output to be consistent before and after the program
started.
Tested under MacOSX 10.15, with the latest lldb (f058d397ff8). The issue isn't
C++ specific, as it was found while working on <a href="https://reviews.llvm.org/D79559">https://reviews.llvm.org/D79559</a>
.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>