Skip to content

Instantly share code, notes, and snippets.

@lbrugnara
Created June 26, 2019 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbrugnara/16fd3fcbf3876e6b829a5dfd0d46973c to your computer and use it in GitHub Desktop.
Save lbrugnara/16fd3fcbf3876e6b829a5dfd0d46973c to your computer and use it in GitHub Desktop.
clang-cl-x86-float.log
C:\projects\c\poc
λ clang-x86.bat
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.2
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
C:\projects\c\poc
λ clang-cl -v
clang version 8.0.0 (tags/RELEASE_800/final)
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: D:\dev\LLVM\x86\bin
C:\projects\c\poc
λ clang-cl /Zi /Od main.c
C:\projects\c\poc
λ lldb main.exe
(lldb) target create "main.exe"
Current executable set to 'main.exe' (i686).
(lldb) break set -f main.c -l 13
Breakpoint 1: where = main.exe`_main + 142 at main.c:13, address = 0x00406cbe
(lldb) run
Process 19184 launched: 'C:\projects\c\poc\main.exe' (i686)
Process 19184 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x00146cbe main.exe`_main(argc=1, argv=0x00b2d9d0) at main.c:13
10 int ret = (size * d);
11 printf("ret=%d\n", ret);
12
-> 13 return ret;
14 }
(lldb) p size
(int) $0 = 60
(lldb) p d
(float) $1 = 1.39999998
(lldb) p ret
(int) $2 = 84
(lldb) c
Process 19184 resuming
Process 19184 exited with status = 84 (0x00000054)
(lldb) quit
// Console's output for this scenario is:
// size=60
// float=1.400000
// ret=84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment