brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 5f527fa Raw
85 lines · plain
1RUN: rm -rf %t && mkdir %t2 3# Check --check-globals all in normal mode and in --include-generated-funcs mode.4 5RUN: cp %S/Inputs/check-globals.c %t/norm.c6RUN: %update_cc_test_checks %t/norm.c --check-globals all7RUN: FileCheck %s --input-file=%t/norm.c --match-full-lines -strict-whitespace \8RUN:   -check-prefixes=BOTH,NRM9 10RUN: cp %S/Inputs/check-globals.c %t/igf.c11RUN: %update_cc_test_checks %t/igf.c --check-globals all --include-generated-funcs12RUN: FileCheck %s --input-file=%t/igf.c --match-full-lines -strict-whitespace \13RUN:   -check-prefixes=BOTH,IGF14 15# Check that repeating doesn't change it, such as duplicating '//.' occurrences.16 17RUN: cp %t/norm.c %t/norm-again.c18RUN: %update_cc_test_checks %t/norm-again.c --check-globals all19RUN: diff -u %t/norm.c %t/norm-again.c20RUN: rm %t/norm-again.c21 22RUN: cp %t/igf.c %t/igf-again.c23RUN: %update_cc_test_checks %t/igf-again.c --check-globals all \24RUN:     --include-generated-funcs25RUN: diff -u %t/igf.c %t/igf-again.c26RUN: rm %t/igf-again.c27 28# Check that the generated directives actually work correctly.  For example,29# they're not in the wrong order.30 31RUN: cp %S/Inputs/lit.cfg.example %t/lit.cfg32# Show lit failures while avoiding confusing FileCheck input dump nesting.33RUN: %lit %t34# Lit was successful.  Sanity-check the results with deterministic test order.35RUN: rm %t/.lit_test_times.txt36RUN: %lit %t 2>&1 | FileCheck -check-prefix=LIT-RUN %s37 38END.39 40  BOTH-NOT:{{.}}41       NRM:// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals42       IGF:// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals --include-generated-funcs43 BOTH-NEXT:// {{.*}}44 BOTH-NEXT:// RUN: true45 BOTH-NEXT:// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s46BOTH-EMPTY:47  IGF-NEXT:void foo(void) {48  IGF-NEXT:  static int i, j;49  IGF-NEXT:}50  IGF-NEXT:void bar(void) {51  IGF-NEXT:  static int i, j;52  IGF-NEXT:}53 BOTH-NEXT://.54 BOTH-NEXT:// CHECK: @foo.i = internal global i32 0, align 455 BOTH-NEXT:// CHECK: @foo.j = internal global i32 0, align 456 BOTH-NEXT:// CHECK: @bar.i = internal global i32 0, align 457 BOTH-NEXT:// CHECK: @bar.j = internal global i32 0, align 458 BOTH-NEXT://.59 BOTH-NEXT:// CHECK-LABEL: @foo(60 BOTH-NEXT:// CHECK-NEXT:  entry:61 BOTH-NEXT:// CHECK-NEXT:    ret void62 BOTH-NEXT://63  NRM-NEXT:void foo(void) {64  NRM-NEXT:  static int i, j;65  NRM-NEXT:}66  IGF-NEXT://67 BOTH-NEXT:// CHECK-LABEL: @bar(68 BOTH-NEXT:// CHECK-NEXT:  entry:69 BOTH-NEXT:// CHECK-NEXT:    ret void70 BOTH-NEXT://71  NRM-NEXT:void bar(void) {72  NRM-NEXT:  static int i, j;73  NRM-NEXT:}74 BOTH-NEXT://.75 BOTH-NEXT:// CHECK: attributes {{.*}}76 BOTH-NEXT://.77 BOTH-NEXT:// CHECK: {{\[\[META0:!\[0-9\]\+\]\]}} = {{.*}}78 BOTH-NEXT:// CHECK: {{\[\[META1:!\[0-9\]\+\]\]}} = {{.*}}79 BOTH-NEXT://.80  BOTH-NOT:{{.}}81 82LIT-RUN: Testing: 2 tests83LIT-RUN: PASS: {{.*}} igf.c84LIT-RUN: PASS: {{.*}} norm.c85