[cfe-dev] g++ test net20.c generates wrong code

Pankaj Gode godepankaj at yahoo.com
Wed Feb 27 01:05:23 PST 2013


Hi All,
 
I am using the  net20.c test case for pointer to member function to compile with clang.
 
This test generates wrong code when compiled using 
'clang  -x c++ ...'
 
https://llvm.org/viewvc/llvm-project/clang-tests/trunk/gcc-4_2-testsuite/src/g%2B%2B.old-deja/g%2B%2B.mike/net20.C?diff_format=c&view=markup&sortby=date
 
 
The output it prints is:
define { i32, i32 } @_Z3feev() nounwind {
entry:
  %retval = alloca { i32, i32 }, align 4
  br label %lab, !dbg !16
lab:                                              ; preds = %lab, %entry
  br label %lab, !dbg !18
return:                                           ; No predecessors!
  %0 = load { i32, i32 }* %retval, !dbg !19
  ret { i32, i32 } %0, !dbg !19
}

Here I see the function is returning '{i32,i32}' i.e. pointer to member function, which is not right, as it should  return 'void'.
 
Is clang not recognizing this correctly or am I making any mistake ?
 
Thanks & Regards,
Pankaj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130227/7c816606/attachment.html>


More information about the cfe-dev mailing list