[LLVMbugs] [Bug 9559] New: post-increment in formal argument list ignored

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 25 14:20:55 PDT 2011


           Summary: post-increment in formal argument list ignored
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ahatanak at gmail.com
                CC: llvmbugs at cs.uiuc.edu

In the following example, main returns with exit code 1 because function sub
returns i instead of i+1.

# .c file
sub (int i, int array[i++])
  return i;

  int array[10];
  exit (sub (10, array) != 11);

# .ll file.                             
# clang tests-c/970217-1.c -emit-llvm -O3 -S -o -
; ModuleID = 'tests-c/970217-1.c'
target datalayout =
target triple = "i386-pc-linux-gnu"

define i32 @sub(i32 %i, i32* nocapture %array) nounwind readnone {
  ret i32 %i

define i32 @main() noreturn nounwind {
  tail call void @exit(i32 1) noreturn nounwind

declare void @exit(i32) noreturn

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