Skip to content

Instantly share code, notes, and snippets.

@mattmassicotte
Created September 19, 2012 15:26
Show Gist options
  • Save mattmassicotte/3750246 to your computer and use it in GitHub Desktop.
Save mattmassicotte/3750246 to your computer and use it in GitHub Desktop.
Test input for arm assembly differences
// clang -arch armv7 -framework Foundation -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -S arm-test.m -o armv7-test.s
#import <Foundation/Foundation.h>
int main(const int argc, const char* const* argv) {
@autoreleasepool {
NSString* string;
string = @"hello";
NSLog(@"print: %s", [string UTF8String]);
}
return 0;
}
@mattmassicotte
Copy link
Author

Without optimization, the arm code appears identical. With -O3, the code deviates substantially.

@mattmassicotte
Copy link
Author

Still unsure if ABI is the same...

@mattmassicotte
Copy link
Author

Take that back, only a little different. Still, interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment