================
@@ -0,0 +1,182 @@
+// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-linux 
-target-feature +xsave -target-feature +xsaveopt -target-feature +xsavec 
-target-feature +xsaves -fclangir -emit-cir -o %t.cir -Wall -Werror
+// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
+// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-linux 
-target-feature +xsave -target-feature +xsaveopt -target-feature +xsavec 
-target-feature +xsaves -fclangir -emit-llvm -o %t.ll -Wall -Werror
+// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
+
+// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-linux 
-target-feature +xsave -target-feature +xsaveopt -target-feature +xsavec 
-target-feature +xsaves -emit-llvm -o - -Wall -Werror | FileCheck %s 
-check-prefix=OGCG
+
+void test_xsave(void *p, unsigned long long m) {
+  // CIR-LABEL: test_xsave
+  // CIR: cir.const #cir.int<32> : !s64i
+  // CIR: cir.shift(right, {{.*}} : !u64i, {{.*}} : !s64i) -> !u64i
+  // CIR: cir.cast integral %{{.*}} : !u64i -> !s32i
+  // CIR: cir.cast integral %{{.*}} : !u64i -> !s32i
+  // CIR: cir.call_llvm_intrinsic "x86.xsave"
----------------
medhatiwari wrote:

Updated! Added detailed checks for test_xsave showing the full use-def flow 
(load → const → shift → cast → intrinsic call) for CIR, LLVM, and OGCG. Added a 
comment explaining that the other tests follow the same pattern.

https://github.com/llvm/llvm-project/pull/170877
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to