[LLVMbugs] [Bug 337] NEW: SetLE/GE/LT/GT On Loaded Long Arguments Always Returns FALSE

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun May 9 16:08:54 PDT 2004


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=337

           Summary: SetLE/GE/LT/GT On Loaded Long Arguments Always Returns
                    FALSE
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rspencer at x10sys.com
                CC: sabre at nondot.org


The attached test case loads two longs from global constants (7 and 49),
compares them with SetLE, casts them to int, and returns the value from main.
This should give a program with a result value of 0 or 1. However, it always
returns 0. It should return 1 because 7 <= 49.

Here's the test case:

%global_long_1 = linkonce global long 7
%global_long_2 = linkonce global long 49
                                                                               
                                                            
implementation   ; Functions:
                                                                               
                                                            
declare void %exit(int)
                                                                               
                                                            
int %main() {
        %long_1 = getelementptr long* %global_long_1, long 0
        %long_2 = getelementptr long* %global_long_2, long 0
                                                                               
                                                            
        %l1 = load long* %long_1
        %l2 = load long* %long_2
                                                                               
                                                            
        %cond = setle long %l1, %l2
        %cast2 = cast bool %cond to int
        ret int %cast2
}



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list