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: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs