Skip to content

Instantly share code, notes, and snippets.

@jedisct1
Created September 24, 2019 11:24
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 jedisct1/8188b1c4aeddd1f5cde84245ddb83c8a to your computer and use it in GitHub Desktop.
Save jedisct1/8188b1c4aeddd1f5cde84245ddb83c8a to your computer and use it in GitHub Desktop.
// Test case for Xcode 11 broken stack alignment
// See https://forums.developer.apple.com/thread/121887
// Compile with `cc -mavx -O2 a.c`
int main(void) {
register char a __asm("rbx") = 0;
char b[5000];
char c[100] = {0};
asm volatile("" : : "r,m"(a), "r,m"(b), "r,m"(c) : "memory");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment