I’m at ToT for llvm and clang, and I am seeing the following test failure on Mac OS X in the CodeGen module:
(kremenek@grue:CodeGen)$ …/TestRunner.sh atomic.c
******************** TEST ‘atomic.c’ FAILED! ********************
Command:
clang atomic.c -emit-llvm -o - > Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.las.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.lss.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.load.min.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.load.max.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.load.umin.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.load.umax.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.swap.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.lcs.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.load.and.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.load.or.i32 Output/atomic.c.out.tmp1 &&
grep @llvm.atomic.load.xor.i32 Output/atomic.c.out.tmp1
Incorrect Output:
******************** TEST ‘atomic.c’ FAILED! ********************
Anyone else seeing this?
More information:
(kremenek@grue:CodeGen)$ cat Output/atomic.c.out.tmp1
; ModuleID = ‘atomic.c’
target datalayout = “e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128”
target triple = “i686-apple-darwin9.3.0”
define i32 @atomic() {
entry:
%old = alloca i32, align 4 ; <i32*> [#uses=12]
%val = alloca i32, align 4 ; <i32*> [#uses=10]
%uval = alloca i32, align 4 ; <i32*> [#uses=3]
%cmp = alloca i32, align 4 ; <i32*> [#uses=1]
store i32 1, i32* %val
store i32 1, i32* %uval
store i32 0, i32* %cmp
call i32 @llvm.atomic.load.add.i32( i32* %val, i32 1 ) ; :0 [#uses=1]
store i32 %0, i32* %old
call i32 @llvm.atomic.load.sub.i32( i32* %val, i32 2 ) ; :1 [#uses=1]
store i32 %1, i32* %old
call i32 @llvm.atomic.load.min.i32( i32* %val, i32 3 ) ; :2 [#uses=1]
store i32 %2, i32* %old
call i32 @llvm.atomic.load.max.i32( i32* %val, i32 4 ) ; :3 [#uses=1]
store i32 %3, i32* %old
call i32 @llvm.atomic.load.umin.i32( i32* %uval, i32 5 ) ; :4 [#uses=1]
store i32 %4, i32* %old
call i32 @llvm.atomic.load.umax.i32( i32* %uval, i32 6 ) ; :5 [#uses=1]
store i32 %5, i32* %old
call i32 @llvm.atomic.swap.i32( i32* %val, i32 7 ) ; :6 [#uses=1]
store i32 %6, i32* %old
call i32 @llvm.atomic.cmp.swap.i32( i32* %val, i32 4, i32 1976 ) ; :7 [#uses=1]
store i32 %7, i32* %old
call i32 @llvm.atomic.load.and.i32( i32* %val, i32 9 ) ; :8 [#uses=1]
store i32 %8, i32* %old
call i32 @llvm.atomic.load.or.i32( i32* %val, i32 10 ) ; :9 [#uses=1]
store i32 %9, i32* %old
call i32 @llvm.atomic.load.xor.i32( i32* %val, i32 11 ) ; :10 [#uses=1]
store i32 %10, i32* %old
%tmp = load i32* %old ; [#uses=1]
ret i32 %tmp
}
declare i32 @llvm.atomic.load.add.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.load.sub.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.load.min.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.load.max.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.load.umin.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.load.umax.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.cmp.swap.i32(i32*, i32, i32) nounwind
declare i32 @llvm.atomic.load.and.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.load.or.i32(i32*, i32) nounwind
declare i32 @llvm.atomic.load.xor.i32(i32*, i32) nounwind