diff --git a/.github/workflows/xcodebuild.yml b/.github/workflows/xcodebuild.yml index d231dba..957ca84 100644 --- a/.github/workflows/xcodebuild.yml +++ b/.github/workflows/xcodebuild.yml @@ -34,19 +34,21 @@ jobs: - run: xcodebuild -version - name: macOS with UTF16 if: always() - run: YAMS_DEFAULT_ENCODING=UTF16 xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} test | xcpretty + run: YAMS_DEFAULT_ENCODING=UTF16 xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} -destination "platform=macOS,arch=$(uname -m)" test | xcpretty shell: bash - name: macOS with UTF8 if: always() - run: YAMS_DEFAULT_ENCODING=UTF8 xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} test | xcpretty + run: YAMS_DEFAULT_ENCODING=UTF8 xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} -destination "platform=macOS,arch=$(uname -m)" test | xcpretty shell: bash - name: iPhone Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} test -sdk iphonesimulator -destination "name=iPhone 15" | xcpretty + run: | + destination_id="$(xcrun simctl list devices available -j | jq -er '[.devices[] | .[] | select(.name | startswith("iPhone"))][0].udid')" + xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} test -sdk iphonesimulator -destination "platform=iOS Simulator,id=$destination_id" | xcpretty shell: bash - name: Apple TV Simulator if: always() - run: xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} test -sdk appletvsimulator -destination "name=Apple TV 4K" | xcpretty + run: xcodebuild ${{ matrix.xcode_flags }} ${{ matrix.flags_for_test }} test -sdk appletvsimulator -destination "platform=tvOS Simulator,name=Apple TV" | xcpretty shell: bash - name: watchOS Simulator if: always() diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fa70c1..b46c821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ##### Bug Fixes -* None. +* Preserve trampoline argument registers in code-coverage builds. ## 0.01 @@ -25,4 +25,4 @@ ##### Bug Fixes -* None. \ No newline at end of file +* None. diff --git a/Sources/SuperBuilder/src/ITKSuperBuilder.m b/Sources/SuperBuilder/src/ITKSuperBuilder.m index 9101052..f698c07 100644 --- a/Sources/SuperBuilder/src/ITKSuperBuilder.m +++ b/Sources/SuperBuilder/src/ITKSuperBuilder.m @@ -168,9 +168,15 @@ static BOOL ITKMethodIsSuperTrampoline(Method method) { https://azeria-labs.com/functions-and-the-stack-part-7/ */ +#if __has_attribute(no_profile_instrument_function) +#define ITK_NAKED_TRAMPOLINE __attribute__((__naked__, no_profile_instrument_function)) +#else +#define ITK_NAKED_TRAMPOLINE __attribute__((__naked__)) +#endif + #if defined(__arm64__) -__attribute__((__naked__)) +ITK_NAKED_TRAMPOLINE void msgSendSuperTrampoline(void) { asm volatile ( @@ -224,7 +230,7 @@ void msgSendSuperStretTrampoline(void) {} #elif defined(__x86_64__) -__attribute__((__naked__)) +ITK_NAKED_TRAMPOLINE void msgSendSuperTrampoline(void) { asm volatile ( // push frame pointer @@ -292,7 +298,7 @@ asm volatile ( } -__attribute__((__naked__)) +ITK_NAKED_TRAMPOLINE void msgSendSuperStretTrampoline(void) { asm volatile ( // push frame pointer