diff --git a/clang/test/CIR/Transforms/Target/x86_64/x86_64-call-conv-lowering-pass.cpp b/clang/test/CIR/Transforms/Target/x86_64/x86_64-call-conv-lowering-pass.cpp index d431f9ed1db9..2ead4bbba761 100644 --- a/clang/test/CIR/Transforms/Target/x86_64/x86_64-call-conv-lowering-pass.cpp +++ b/clang/test/CIR/Transforms/Target/x86_64/x86_64-call-conv-lowering-pass.cpp @@ -34,3 +34,31 @@ unsigned long long ULongLong(unsigned long long l) { // CHECK: cir.call @_Z9ULongLongy(%2) : (!u64i) -> !u64i return ULongLong(l); } + +/// Test call conv lowering for trivial signext cases. /// + +// CHECK: cir.func @_Z4Chara(%arg0: !s8i {cir.signext} loc({{.+}})) -> (!s8i {cir.signext}) +char Char(signed char c) { + // CHECK: cir.call @_Z4Chara(%{{.+}}) : (!s8i) -> !s8i + return Char(c); +} +// CHECK: cir.func @_Z5Shorts(%arg0: !s16i {cir.signext} loc({{.+}})) -> (!s16i {cir.signext}) +short Short(short s) { + // CHECK: cir.call @_Z5Shorts(%{{.+}}) : (!s16i) -> !s16i + return Short(s); +} +// CHECK: cir.func @_Z3Inti(%arg0: !s32i loc({{.+}})) -> !s32i +int Int(int i) { + // CHECK: cir.call @_Z3Inti(%{{.+}}) : (!s32i) -> !s32i + return Int(i); +} +// CHECK: cir.func @_Z4Longl(%arg0: !s64i loc({{.+}})) -> !s64i +long Long(long l) { + // CHECK: cir.call @_Z4Longl(%{{.+}}) : (!s64i) -> !s64i + return Long(l); +} +// CHECK: cir.func @_Z8LongLongx(%arg0: !s64i loc({{.+}})) -> !s64i +long long LongLong(long long l) { + // CHECK: cir.call @_Z8LongLongx(%{{.+}}) : (!s64i) -> !s64i + return LongLong(l); +}