Created
February 14, 2018 16:23
-
-
Save aykevl/ecdb91a6ade834879849dde160fa36fc to your computer and use it in GitHub Desktop.
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
#include <stdio.h> | |
__attribute__((used)) | |
int bar() { | |
printf("bar\n"); | |
return 42; | |
} | |
__attribute__((noinline,naked)) | |
int foo() { | |
asm("b bar\n"); | |
// The following can be uncommented, resulting in invalid code. | |
//__builtin_unreachable(); | |
} | |
int main() { | |
int n = foo(); | |
printf("the number is: %d\n", n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment