[flang] Fix length handling in character kind implicit conversion (#74586)
[llvm-project.git] / lldb / test / Shell / Process / Windows / exception_access_violation.cpp
blob4835b498ee4dfd4b942b62b7ac4db5b88c3ddfd3
1 // clang-format off
3 // REQUIRES: system-windows
4 // RUN: %build --compiler=clang-cl -o %t.exe -- %s
5 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o "run" -- write | FileCheck --check-prefix=WRITE %s
6 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o "run" -- read | FileCheck --check-prefix=READ %s
8 #include <string.h>
10 int access_violation_write(void* addr) {
11 *(int*)addr = 42;
12 return 0;
16 int access_violation_read(void* addr) {
17 volatile int ret = *(int*)addr;
18 return ret;
21 int main(int argc, char *argv[]) {
22 if (argc < 2) {
23 return 1;
25 if (strcmp(argv[1], "write") == 0) {
26 return access_violation_write((void*)42);
28 if (strcmp(argv[1], "read") == 0) {
29 return access_violation_read((void*)42);
31 return 1;
35 // WRITE: * thread #1, stop reason = Exception 0xc0000005 encountered at address {{.*}}: Access violation writing location 0x0000002a
37 // READ: * thread #1, stop reason = Exception 0xc0000005 encountered at address {{.*}}: Access violation reading location 0x0000002a