Created
January 29, 2016 19:08
-
-
Save amidvidy/6c0b803e2cf836cdd5b9 to your computer and use it in GitHub Desktop.
undefined behavior is cool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ scratch cat both.c | |
#include <stdio.h> | |
int main(void) { | |
int a; | |
if (!(a == 0)) puts("ha"); | |
if (!(a != 0)) puts("ho"); | |
return 0; | |
} | |
➜ scratch ~/Documents/svnroot/llvm/build/bin/clang -O1 both.c | |
➜ scratch ./a.out | |
ha | |
ho | |
➜ scratch ~/Documents/svnroot/llvm/build/bin/clang -v | |
clang version 3.8.0 (trunk 245221) | |
Target: x86_64-unknown-linux-gnu | |
Thread model: posix | |
InstalledDir: /home/amidvidy/Documents/svnroot/llvm/build/bin | |
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.2.1 | |
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8 | |
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4 | |
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9 | |
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2 | |
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.2.1 | |
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.2.1 | |
Candidate multilib: .;@m64 | |
Candidate multilib: 32;@m32 | |
Candidate multilib: x32;@mx32 | |
Selected multilib: .;@m64 | |
➜ scratch | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment