From 18fe720fbd54ec55380117237d02306247223a57 Mon Sep 17 00:00:00 2001 From: Vinicius Couto Espindola Date: Mon, 1 Jul 2024 21:00:49 -0300 Subject: [PATCH] [CIR][ABI][NFC] Add missing x86-64 signed int CC lowering tests --- .../x86_64/x86_64-call-conv-lowering-pass.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) 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); +}