[LLVMbugs] [Bug 3752] New: @encode() codegen does not match GCC

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Mar 7 12:36:27 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3752

           Summary: @encode() codegen does not match GCC
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=2681)
 --> (http://llvm.org/bugs/attachment.cgi?id=2681)
Simple test case

GCC use to returns the same string pointer for all @encode() directive with the
same type, and so it's possible (using GCC) to compare @encode() values using
the '==' operator.

Actually, clang returns a different pointer for each @encode directive.

The SenTestingKit distributed with Xcode rely on this behavior in the Unit
Tests Assertions macros, and so, some test failed when they are compiled using
clang.


------------ encode.m ----------------
#include <stdio.h>

int main(int argc, char **argv) {
        if (@encode(id) != @encode(id))
                fprintf(stderr, "types do not match !!!\n");
        return 0;
}
----------------------------------

[MacBook:~/Desktop]% gcc -o encode encode.m
[MacBook:~/Desktop]% ./encode
[MacBook:~/Desktop]% ccc -o encode encode.m
[MacBook:~/Desktop]% ./encode
types do not match !!!


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list