// RUN: | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \
// RUN: > %t.exports
//
-// RUN: sed ':a;N;$!ba;s/([\n ]*/(/g' \
+// note: SED differs between GNU and BSD in handling semicolon and the use of
+// '\n' in regex patterns. For macOS we must change this GNU syntax:
+// sed -e ':a' -e 'N' -e '$!ba'
+// to a form that both GNU and BSD can agree upon (below).
+//
+// RUN: sed -e ':a' -e 'N' -e '$!ba' \
+// RUN: -e 's/ //g' \
+// RUN: -e ':b' -e 's/\n\n/\n/g' -e 'tb' \
+// RUN: -e 's/(\n/(/g' \
// RUN: %t.asan_interface.inc \
// RUN: %p/../../../../lib/ubsan/ubsan_interface.inc \
// RUN: %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc \