brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · d128968 Raw
84 lines · c
1// RUN: %clang_cc1 -x assembler-with-cpp -E %s -o - | FileCheck -strict-whitespace -check-prefix=CHECK-Identifiers-False %s2 3#ifndef __ASSEMBLER__4#error "__ASSEMBLER__ not defined"5#endif6 7 8// Invalid token pasting is ok. 9#define A X ## .101: A11// CHECK-Identifiers-False: 1: X .12 13// Line markers are not linemarkers in .S files, they are passed through.14# 32115// CHECK-Identifiers-False: # 32116 17// Unknown directives are passed through.18# B C19// CHECK-Identifiers-False: # B C20 21// Unknown directives are expanded.22#define D(x) BAR ## x23# D(42)24// CHECK-Identifiers-False: # BAR4225 26// Unmatched quotes are permitted.272: '283: "29// CHECK-Identifiers-False: 2: '30// CHECK-Identifiers-False: 3: "31 32// (balance quotes to keep editors happy): "'33 34// Empty char literals are ok.354: ''36// CHECK-Identifiers-False: 4: ''37 38 39// Portions of invalid pasting should still expand as macros.40#define M4 expanded41#define M5() M4 ## (42 435: M5()44// CHECK-Identifiers-False: 5: expanded (45 46#define FOO(name)  name ## $foo476: FOO(blarg)48// CHECK-Identifiers-False: 6: blarg $foo49 50// RUN: %clang_cc1 -x assembler-with-cpp -fdollars-in-identifiers -E %s -o - | FileCheck -check-prefix=CHECK-Identifiers-True -strict-whitespace %s51#define FOO(name)  name ## $foo527: FOO(blarg)53// CHECK-Identifiers-True: 7: blarg$foo54 55// 56#define T6() T6 #nostring57#define T7(x) T7 #x588: T6()599: T7(foo)60// CHECK-Identifiers-True: 8: T6 #nostring61// CHECK-Identifiers-True: 9: T7 "foo"62 63// Concatenation with period doesn't leave a space64#define T8(A,B) A ## B6510: T8(.,T8)66// CHECK-Identifiers-True: 10: .T867 68// This should not crash.69#define T11(a) #07011: T11(b)71// CHECK-Identifiers-True: 11: #072 73// Universal character names can specify basic ascii and control characters7412: \u0020\u003075// CHECK-Identifiers-False: 12: \u0020\u003076 77// This should not crash78# ##79// CHECK-Identifiers-False: # ##80 81#define X(a) # # # 182X(1)83// CHECK-Identifiers-False: # # # 184