Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / SystemZ / vec-abi-gnuattr-24.c
blob54d7dc915cec2bf02919ebc7cccae561b0d50f22
1 // RUN: %clang_cc1 -triple s390x-ibm-linux -emit-llvm -fzvector -o - %s 2>&1 \
2 // RUN: | FileCheck %s
3 //
4 // Test that the "s390x-visible-vector-ABI" module flag is not emitted.
6 // Use of va_arg with a scalar type.
7 #include <stdarg.h>
8 int fun0(va_list vl) {
9 return va_arg(vl, int);
12 typedef __attribute__((vector_size(16))) int v4i32;
14 // Declaring unused global function with vector argument and return values;
15 v4i32 globfun(v4i32 Arg);
17 // Declaring global scalar variable used below.
18 int GlobVal;
20 // Declaring extern global scalar variable used below.
21 extern int GlobExtVar;
23 // Local vector variable used below.
24 static v4i32 Var;
26 // Local function with vector argument and return values;
27 static v4i32 foo(v4i32 Arg) {
28 Var = Var + Arg;
29 return Var;
32 int fun1() {
33 v4i32 V = {1, 2, 3, 4};
34 return foo(V)[0] + GlobVal + GlobExtVar;
37 // Globally visible vector variable less than 16 bytes in size.
38 typedef __attribute__((vector_size(8))) int v2i32;
39 v2i32 NarrowVecVar;
41 // Global function taking narrow vector array and pointer.
42 void bar(v2i32 VArr[4], v2i32 *Dst) { *Dst = VArr[3]; }
44 // Wide vector parameters via "hidden" pointers.
45 typedef __attribute__((vector_size(32))) int v8i32;
46 v8i32 bar2(v8i32 Arg) { return Arg; }
48 // Same but with a single element struct.
49 struct SingleElStruct { v8i32 B; };
50 struct SingleElStruct bar3(struct SingleElStruct Arg) { return Arg; }
53 //CHECK-NOT: !{i32 2, !"s390x-visible-vector-ABI", i32 1}