Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- set -e
- function c_file {
- C_FILE=$(cat << EOF
- $CC int foo(int a, int b) {
- return a+b;
- }
- EOF
- )
- }
- ICC="/opt/intel/bin/icc"
- for CC in "__attribute((cdecl))" "__attribute((stdcall))" "__attribute__((ms_abi))" "__attribute__((regcall))"; do
- c_file $CC
- TMP=$(mktemp)
- echo "$CC"
- echo $C_FILE | $ICC -g -x c -c /dev/stdin -o "$TMP"
- readelf --debug-dump "$TMP" |grep calling_convention || true
- rm $TMP
- echo "===="
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement