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

           Summary: miscompile of switch
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


This testcase is reduced from gperf:

  #include <stdlib.h>
  #include <stdio.h>

  int main(int argc, char **argv) {
    int option_char = 'm';

    switch (option_char) {
      case 'm':
        printf("Z m\n");
        break;
      default:
       printf("nonsense\n");
       exit(1);
    }
    exit(0);
  }

When built with "clang++ switch.cc -o switch" (at r129824), the program always
runs the 'm' case:

nlewycky@ducttape:~$ ./switch a
Z m
nlewycky@ducttape:~$ ./switch m
Z m

-- 
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

Reply via email to