Advertisement
Guest User

Untitled

a guest
Feb 1st, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3.  
  4. set -e
  5.  
  6. function c_file {
  7.   C_FILE=$(cat << EOF
  8. $CC int foo(int a, int b) {
  9.   return a+b;
  10. }
  11. EOF
  12. )
  13. }
  14.  
  15. ICC="/opt/intel/bin/icc"
  16.  
  17. for CC in "__attribute((cdecl))" "__attribute((stdcall))" "__attribute__((ms_abi))" "__attribute__((regcall))"; do
  18.   c_file $CC
  19.   TMP=$(mktemp)
  20.   echo "$CC"
  21.   echo $C_FILE | $ICC -g -x c -c /dev/stdin -o "$TMP"
  22.   readelf --debug-dump "$TMP" |grep calling_convention || true
  23.   rm $TMP
  24.   echo "===="
  25. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement